Closed benmccann closed 3 years ago
Not having to escape things is endlessly cleaner to look at.
Why not simply use the "avoidEscape": true
property and use the opposite quote style?
allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
In your case, this would mean using double quotes, since you use single quotes to declare a string. IMO the wrong choice to use single quotes, because they are used by words like aren't, can't, don't, that's, I'd, haven't, etc., but that's another topic.
I've sent https://github.com/sveltejs/eslint-config/pull/8 as an alternative to this
Please vote with a thumbs up or thumbs down on whether you prefer this potential change
This PR allows strings to use either single quotes and template literals as the user chooses. This would allow the user to write strings in template literals without escaping single quotes such as
No custom element 'tag' option was specified
The currently checked in code does not allow template literals unless they reference a variable, so strings with single quotes should be written either as
No custom element \'tag\' option was specified
orNo custom element "tag" option was specified
. It offers more firmness around users using single quotes for a string likefoobar
with no quotes or variables