noUnusedTemplateLiteral (since v1.0.0)
Diagnostic Category: lint/style/noUnusedTemplateLiteral
Disallow template literals if interpolation and special-character handling are not needed
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-block.js:1:13 lint/style/noUnusedTemplateLiteral FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Do not use template literals if interpolation and special-character handling are not needed.
> 1 │ const foo = `bar`
│ ^^^^^
2 │
ℹ Unsafe fix: Replace with string literal
1 │ - const·foo·=·`bar`
1 │ + const·foo·=·"bar"
2 2 │
code-block.js:1:13 lint/style/noUnusedTemplateLiteral FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Do not use template literals if interpolation and special-character handling are not needed.
> 1 │ const foo = `bar `
│ ^^^^^^
2 │
ℹ Unsafe fix: Replace with string literal
1 │ - const·foo·=·`bar·`
1 │ + const·foo·=·"bar·"
2 2 │