void-style
Angular templatesHTMLVue / SvelteVue / Sveltestyleno fixdefault: offhtml/html-validate-recommendedhtml/htmlhint
What it does
Section titled “What it does”Reports a / at the end of a void element (<br/>, <img />).
Why it matters
Section titled “Why it matters”A void element has no end tag and the slash is ignored, so it adds nothing; it only suggests the tag is closed like XML, which can mislead a reader about other elements such as <div/>.
To fix, write <br>.
Example
Section titled “Example”...<p style="display: none">ok</p><br/><br>...<svg viewBox="0 0 1 1"><linearGradient gradientUnits="x"></linearGradient></svg>...Configuration
Section titled “Configuration”angular: lint: rules: void-style: warn # off (default), warn, errorhtml: lint: rules: void-style: warn # off (default), warn, errorsvelte: lint: rules: void-style: warn # off (default), warn, errorvue: lint: rules: void-style: warn # off (default), warn, errorEnabled by the presets: html/html-validate-recommended, html/htmlhint.
Suppress one line with sudsy-disable-next-line void-style 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 | void-style |
partial | the omit style only, without the style option |
| htmlhint | empty-tag-not-self-closed |
full |