Skip to content

element-name

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.

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.

Reported
...
<title>x</title>
</head>
<body>
<blink2>x</blink2>
...
angular:
lint:
rules:
element-name: warn # off (default), warn, error
html:
lint:
rules:
element-name: warn # off (default), warn, error
svelte:
lint:
rules:
element-name: warn # off (default), warn, error
vue:
lint:
rules:
element-name: warn # off (default), warn, error

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

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
html-validate element-name full