Require template literals instead of string concatenation
Some problems reported by this rule are automatically fixable by the --fix
command line option
In ES2015 (ES6), we can use template literals instead of string concatenation.
This rule is aimed to flag usage of +
operators with strings.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
This rule should not be used in ES3/5 environments.
In ES2015 (ES6) or later, if you don’t want to be notified about string concatenation, you can safely disable this rule.
This rule was introduced in ESLint v1.2.0.
© OpenJS Foundation and other contributors
Licensed under the MIT License.
https://eslint.org/docs/latest/rules/prefer-template