-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Rule proposal: No useless template string, or prefer String() #12866
Copy link
Copy link
Closed
Labels
archived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionauto closedThe bot closed this issueThe bot closed this issueenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLintevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionThe team will evaluate this issue to decide whether it meets the criteria for inclusionruleRelates to ESLint's core rulesRelates to ESLint's core rules
Metadata
Metadata
Assignees
Labels
archived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionauto closedThe bot closed this issueThe bot closed this issueenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLintevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionThe team will evaluate this issue to decide whether it meets the criteria for inclusionruleRelates to ESLint's core rulesRelates to ESLint's core rules
Please describe what the rule should do:
Disallow useless template strings, such as
${x}. The thing is this can be used as a way to cast a variable to string, which means the rule could instead be "prefer String()" or "prefer .toString()".What category of rule is this? (place an "X" next to just one item)
[ ] Warns about a potential error (problem)
[X] Suggests an alternate way of doing something (suggestion)
[ ] Enforces code style (layout)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
Why should this rule be included in ESLint (instead of a plugin)?
Because eslint already had tons of
no-useless-somethingrules, so this one would fit very well with the rest.Are you willing to submit a pull request to implement this rule?
No unless you point me to the right resources and ask nicely and I have enough free time this week