no-implicit-close
Angular templatesHTMLVue / SvelteVue / Sveltestyleno fixdefault: offhtml/html-validate-recommendedhtml/htmlhinthtml/html-eslint-recommended
What it does
Section titled “What it does”Reports an element whose end tag is left out and that the next sibling or the end tag of its parent closes (<li>, <p>, …). Void and self-closed elements have no end tag and are not reported.
Why it matters
Section titled “Why it matters”The rules for the implied end are complex: a <p> ends when a <div> begins, a <li> when the next <li> begins. A reader and a tool cannot always tell where an element ends, and an edit can change it.
To fix, write the end tag.
Example
Section titled “Example”<!DOCTYPE html><ul><li>a<li>b</li></ul><p>x</p>...Configuration
Section titled “Configuration”angular: lint: rules: no-implicit-close: warn # off (default), warn, errorhtml: lint: rules: no-implicit-close: warn # off (default), warn, errorsvelte: lint: rules: no-implicit-close: warn # off (default), warn, errorvue: lint: rules: no-implicit-close: warn # off (default), warn, errorEnabled by the presets: html/html-validate-recommended, html/htmlhint, html/html-eslint-recommended.
Suppress one line with sudsy-disable-next-line no-implicit-close in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| html-validate | no-implicit-close |
full | |
| htmlhint | tag-pair |
partial | a stray end tag is the parser’s syntax-error, an unclosed element is no-implicit-close |