diff --git a/lib/rules/prefer-template.js b/lib/rules/prefer-template.js index b3656a575dd..cc53935ab3d 100644 --- a/lib/rules/prefer-template.js +++ b/lib/rules/prefer-template.js @@ -203,7 +203,7 @@ module.exports = { const firstToken = sourceCode.getFirstToken(currentNode.left); const currentNodeText = sourceCode.getText(currentNode); - if (currentNode === currentNode.parent.left) { + if (currentNode.range[0] === currentNode.parent.left.range[0]) { if (isConcatenation(currentNode.right)) { const openingParentesisSign = sourceCode.getFirstTokenBetween(currentNode.left, currentNode.right, token => token.value === "("); const leftNodeText = currentNodeText.slice(0, openingParentesisSign.range[0] - firstToken.range[0]);