element-name
What it does
Section titled “What it does”Reports an element whose name is not a valid custom element name: a custom element is lowercase letters, digits, -, . and _ and has a -. A plain HTML element is not reported, and 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”The dash is what keeps a custom element from clashing with an element that HTML adds later. A name without it is either a typo of a real element or a name that a browser may take over.
To fix, rename the element with a dash (x-card), or correct the typo.
Example
Section titled “Example”...<title>x</title></head><body><blink2>x</blink2>...Configuration
Section titled “Configuration”angular: lint: rules: element-name: warn # off (default), warn, errorhtml: lint: rules: element-name: warn # off (default), warn, errorsvelte: lint: rules: element-name: warn # off (default), warn, errorvue: lint: rules: element-name: warn # off (default), warn, errorEnabled by the presets: html/html-validate-standard.
Suppress one line with sudsy-disable-next-line element-name in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| html-validate | element-name |
full |