Allowing unused template literals #2949
colinhacks
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
The first proposal sounds reasonable, however it would be a breaking change for our versioning contract, because it's a recommended rule, and removing a recommended rule requires a major. The second proposal can't be implemented, unfortunately. Template literals can't be used as replacement for ALL string literals. If we can't replace all string literals, which quote do we use? For example, it can't be used inside module assertions. The following snippet won't parse: import {names} from "module" with { source: `json` } |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm just being annoying at this point, but I don't think it's necessarily widely believed that "unused template literals" are a bad practice. I'm very open to evidence to the contrary!
The proposal here is two-fold:
noUnusedTemplateLiterals
by defaultjavascript.formatter.quoteStyle: "backtick"
Some related Twitter discussion: https://twitter.com/colinhacks/status/1793115510672134326
Beta Was this translation helpful? Give feedback.
All reactions