no-unknown-elements
What it does
Section titled “What it does”Reports an element name that HTML does not define, custom elements (<my-element>) included. Everything inside <svg> and <math> is left alone, and so are .vue, .svelte and *.component.html files, where component names are normal.
Why it matters
Section titled “Why it matters”An unknown element is a typo (<buton>) or a custom element that needs a script to do anything; the browser shows it as an inline box with no meaning.
To fix, correct the name, or turn the rule off for custom elements.
Example
Section titled “Example”...<title>x</title></head><body><blink2>x</blink2><my-element>x</my-element>...Configuration
Section titled “Configuration”angular: lint: rules: no-unknown-elements: warn # off (default), warn, errorhtml: lint: rules: no-unknown-elements: warn # off (default), warn, errorsvelte: lint: rules: no-unknown-elements: warn # off (default), warn, errorvue: lint: rules: no-unknown-elements: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line no-unknown-elements 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-unknown-elements |
partial | no include and exclude options |