lib/rules/prefer-template.js
function checkForStringConcat(node) {
            if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) {
                return;
            }

            const topBinaryExpr = getTopConcatBinaryExpression(node.parent);

            // Checks whether or not this node had been checked already.
            if (done[topBinaryExpr.range[0]]) {
                return;
            }
            done[topBinaryExpr.range[0]] = true;

            if (hasNonStringLiteral(topBinaryExpr)) {
                context.report({
                    node: topBinaryExpr,
                    message: "Unexpected string concatenation.",
                    fix: fixer => fixNonStringBinaryExpression(fixer, node)
                });
            }
        }
function checkForStringConcat(node) {
            if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) {
                return;
            }

            const topBinaryExpr = getTopConcatBinaryExpression(node.parent);

            // Checks whether or not this node had been checked already.
            if (done[topBinaryExpr.range[0]]) {
                return;
            }
            done[topBinaryExpr.range[0]] = true;

            if (hasNonStringLiteral(topBinaryExpr)) {
                context.report({
                    node: topBinaryExpr,
                    message: "Unexpected string concatenation.",
                    fix: fixer => fixNonStringBinaryExpression(fixer, node)
                });
            }
        }
function checkForStringConcat ( node ) { if ( ! astUtils . isStringLiteral ( node ) || ! isConcatenation ( node . parent ) ) { return ; } const topBinaryExpr = getTopConcatBinaryExpression ( node . parent ) ; // Checks whether or not this node had been checked already. if ( done [ topBinaryExpr . range [ 0 ] ] ) { return ; } done [ topBinaryExpr . range [ 0 ] ] = true ; if ( hasNonStringLiteral ( topBinaryExpr ) ) { context . report ( { node : topBinaryExpr , message : "Unexpected string concatenation." , fix : fixer => fixNonStringBinaryExpression ( fixer , node ) } ) ; } }
Reports if a given node is string concatenation with non string literals.

@param {ASTNode} node - A node to check.
@returns {void}
Reports if a given node is string concatenation with non string literals .