HTML rules
HTML validity and semantic markup in templates.
Each rule page shows a failing example, a passing example, and the configuration that turns the rule on.
Essential (1)
Correctness rules in the essential preset.
| Rule | What it checks | Auto-fix |
|---|---|---|
html/id-duplication |
Disallow duplicate element IDs. |
Default (7)
Added by happy-path, the default preset.
| Rule | What it checks | Auto-fix |
|---|---|---|
html/deprecated-attr |
Disallow deprecated HTML attributes. | |
html/deprecated-element |
Disallow deprecated HTML elements. | |
html/no-consecutive-br |
Disallow consecutive <br> elements. | |
html/no-duplicate-class |
Disallow duplicate class names in a static class attribute. | |
html/no-duplicate-dt |
Disallow duplicate <dt> names in <dl>. | |
html/no-empty-palpable-content |
Disallow empty elements that expect visible content. | |
html/require-datetime |
Require datetime attribute on <time> element. |
Stricter presets (1)
Only in opinionated, nuxt or ecosystem. The Presets column lists which.
| Rule | What it checks | Presets | Auto-fix |
|---|---|---|---|
html/no-dupe-style-properties |
Disallow duplicate properties in inline style attributes. | nuxt, opinionated |