43081j / eslint-plugin-lit

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

lit/no-invalid-html rule can get into a fight with Prettier #63

Closed lkraav closed 4 years ago

lkraav commented 4 years ago

Prettier insists on auto-fixing everything towards <hr />-like, and this gets us into a fight with lit/no-invalid-html

Prettier issue has a lengthy discussion that seems to be going towards no action, so I was wondering what this ESLint ruleset thinks about this situation. Should lit/no-invalid-html ruleset maybe be amended for a whitelist of standard HTML5 tags, or...?

43081j commented 4 years ago

I had a quick look at the issue you referenced.

It seems pretty odd, your error is stating that a hr is a non-void element.. but a hr is a void element so that makes no sense.

maybe its a bug in parse5 or we need to update our copy of parse5 🤔 works in ASTExplorer too.

israelfloresdga commented 4 years ago

Any news about this issue?

jorenbroekema commented 4 years ago

I don't think parse5 cares about the tag name or makes a distinction between void elements and non-void elements. So I doubt this is a bug with parse5. I think the linter needs to keep a list of void elements and not error on a missing closing tag or trailing slash.

lkraav commented 4 years ago

Tyvm, this successfully fixes my repo's linting annoyance :+1: