43081j / eslint-plugin-lit

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

Rule idea: prefer adopted stylesheets #86

Closed 43081j closed 3 years ago

43081j commented 3 years ago

Possibly a rule which detects style tags inside templates and recommends they be moved to an adopted stylesheet (whether it be via lit or directly, we wouldn't necessarily care).

It could have one option: a string of "prefer" or "avoid"

Someone might have a reason for preferring style tags that I'm not aware of. So we should probably give the option

If they choose "avoid" I guess we would want to detect static lit styles and adopted stylesheets to tell them not to? Maybe isn't necessary for first cut unless someone has reason you might prefer that