Bug: [no-unnecessary-template-expression] Inconsistent handling of escapes and quotes in autofixes. #8677
Closed
4 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
click here
Repro Code
ESLint Config
tsconfig
Expected Result
I expect that the autofixed strings should preserve the string type and the escaped characters as the author wrote them.
So, we should have
Actual Result
actual autofix results change user's input regarding template and and escaped characters.
Additional Info
This can also result in multiline template literals instead of single line literals that include a
\n
.It doesn't impact correctness at runtime, but it isn't the purview of this rule to make these stylistic changes (with the caveat, of course, that obviously
$
s and backticks still need to be escaped in order to incorporate a string literal into a template string)The text was updated successfully, but these errors were encountered: