43081j / eslint-plugin-lit

lit-html support for ESLint
120 stars 22 forks source link

rule: Expressions can occur in text content or in attribute value positions. #73

Open greg-minshall opened 3 years ago

greg-minshall commented 3 years ago

would it be worth while (and, tractable) to have a rule that enforces the above lit-html constraint? the following concocted code, for example, causes an exception:

render(html`<div ${'data="cancel"'}></div>`, $('body')[0])

while the following produces happiness

render(html`<div data=${"cancel"}></div>`, $('body')[0])

(if that's what you were looking for.)

cheers.