Skip to content

no-implicit-close

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.

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.

Reported
<!DOCTYPE html>
<ul>
<li>a
<li>b</li>
</ul>
<p>x</p>
...
angular:
lint:
rules:
no-implicit-close: warn # off (default), warn, error
html:
lint:
rules:
no-implicit-close: warn # off (default), warn, error
svelte:
lint:
rules:
no-implicit-close: warn # off (default), warn, error
vue:
lint:
rules:
no-implicit-close: warn # off (default), warn, error

Enabled 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.

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