Closed 43081j closed 3 years ago
Could this be
"quoted-expressions": ["error", { "quotes": "always|never" }]
i did consider that, but was wondering what the use case ever would be for quoting them
only reason i didn't do it that way..
if there's good reason to have the choice then i will
since it's a linting rule there's room for project preference
in any event I usually quote always, so it would be better for me to not have to make that lint commit on an existing project
no worries, you are correct 👍 i have already reworked it to have an always
and never
option, and am adding a fixer for it so --fix
will work
ok i've added a fixer and reworked the rule to have an always
/never
option (default: never
).
Disallows:
<foo attr="${val}"></foo>
Allows:
<foo attr="foo ${val} bar"></foo>
@stramel if you get chance can you let me know if this makes sense as a rule, especially the way i've done it.
i went with the 'dumb' approach - just check if an expression is surrounded by quotes so i dont need to re-traverse the template. this means it will also disallow
<foo @event="${handler}">
but i think thats fine