lib/rules/no-template-literals.js
function templateLiteralToStringConcat(node, sourceCode) {
    const ss = []
    node.quasis.forEach((q, i) => {
        const value = q.value.cooked
        if (value) {
            ss.push(JSON.stringify(value))
        }

        if (i < node.expressions.length) {
            const e = node.expressions[i]
            const text = sourceCode.getText(e)
            ss.push(text)
        }
    })
    if (!ss.length || !isStringLiteralCode(ss[0])) {
        ss.unshift(`""`)
    }
    return ss.join("+")
}
function templateLiteralToStringConcat(node, sourceCode) {
    const ss = []
    node.quasis.forEach((q, i) => {
        const value = q.value.cooked
        if (value) {
            ss.push(JSON.stringify(value))
        }

        if (i < node.expressions.length) {
            const e = node.expressions[i]
            const text = sourceCode.getText(e)
            ss.push(text)
        }
    })
    if (!ss.length || !isStringLiteralCode(ss[0])) {
        ss.unshift(`""`)
    }
    return ss.join("+")
}
function templateLiteralToStringConcat ( node , sourceCode ) { const ss = [ ] node . quasis . forEach ( ( q , i ) => { const value = q . value . cooked if ( value ) { ss . push ( JSON . stringify ( value ) ) } if ( i < node . expressions . length ) { const e = node . expressions [ i ] const text = sourceCode . getText ( e ) ss . push ( text ) } } ) if ( ! ss . length || ! isStringLiteralCode ( ss [ 0 ] ) ) { ss . unshift ( ` ` ) } return ss . join ( "+" ) }
Transform template literal to string concatenation.
@param  {ASTNode} node TemplateLiteral node.(not within TaggedTemplateExpression)
@param  {SourceCode} sourceCode SourceCode
@returns {string} After transformation
Transform template literal to string concatenation .