no-template-curly-in-string
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-template-curly-in-string": "error",
},
},
];Disallow template literal placeholder syntax in regular strings
"Hello ${name}!";
'Hello ${name}!';
"Time: ${12 * 60 * 60 * 1000}";`Hello ${name}!`;
`Time: ${12 * 60 * 60 * 1000}`;
templateFunction`Hello ${name}`;Examples from the ESLint documentation.
no-template-curly-in-string
eslint
export default [
{
rules: {
"no-template-curly-in-string": "error",
},
},
];no-template-curly-in-string
eslint plugin · style
{
"rules": {
"no-template-curly-in-string": "error"
}
}suspicious/noTemplateCurlyInString
suspicious · since 1.9.3
{
"linter": {
"rules": {
"suspicious": {
"noTemplateCurlyInString": "error"
}
}
}
}Enforce return statements in callbacks of array methods
Disallow the use of eval()-like methods
Disallow octal escape sequences in string literals