eslint-plugin-lit
eslint-plugin-lit copied to clipboard
False positive when url contains query string
When you have a template like:
html`<a href="/?query=${query}">Link</a>`
It will give the following errors:
Template contained invalid HTML syntax, error was: missing-whitespace-between-attributes eslint(lit/no-invalid-html)
Template contained invalid HTML syntax, error was: unexpected-character-in-attribute-name eslint(lit/no-invalid-html)
You should probably be doing:
html`<a href=${`/?query=${query}`}>Link</a>`;
so lit understands you're interpolating a value. im not sure how lit deals with trying to interpolate part of a value like that, maybe it understands it fine..
as for the error though regardless, its the html parser we use giving that. ill take a look either way when i get chance
+1
yup sorry i took so long to get back to this, ill try have a look into this weekend.
you're right, it should work fine