Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Hi there,
First of all, thanks for this great set of ESLint + TS utilities, these are great!
I am unsure if I'm doing this right, because the issue template was about bug reports, but I would like to propose a new rule. Since I didn't see a template for this, I'm going to go ahead like this, and then can change it / resubmit if necessary.
What I wanted to bring up was the idea of a@typescript-eslint/no-useless-interpolation
rule, similar to theeslint/eslint#10798 proposal to ESLint, which as far as I can tell, never got implemented.
The idea would be, if there is useless interpolation with a template string, this would be an error.
Example ofincorrect code:
`${'abc'}`// incorrectconststr='def';`${str}`// incorrect`123${'abc'}`// incorrect`${'abc'}${'def'}`// incorrect
Examples ofcorrect code:
'abc'// correctconststr='def';str// correct'123abc'// correct'abcdef'// correct
I would suggest only doing this for strings.
Remaining template things
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I haveread the FAQ and my problem is not listed.