From e5fdb7c6b722d66eb3fba87c76e4d1f347c346fc Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 28 Oct 2021 17:58:17 -0700 Subject: [PATCH] chore: update comment --- lib/rules/prefer-template.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rules/prefer-template.js b/lib/rules/prefer-template.js index fbd9b5ca339..787a11dfdc7 100644 --- a/lib/rules/prefer-template.js +++ b/lib/rules/prefer-template.js @@ -203,7 +203,10 @@ module.exports = { if (isConcatenation(currentNode) && !hasIdentifierReference(currentNode)) { - // As there are no varibales used in this concatenation, we can sipmly calculate the concatenated string + /* + * As there are no varibales used in this concatenation, we can sipmly calculate the concatenated string + * "'Hello ' + 'world'" -> ["'Hello ' " , " 'world'"] -> ["Hello ", "world"] -> "Hello world" + */ const concatenatedText = sourceCode.getText(currentNode).split("+").map(e => e.trim().slice(1, -1)).join(""); return `\`${concatenatedText}\``;