Skip to content

no-unknown-elements

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.

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.

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

Suppress one line with sudsy-disable-next-line no-unknown-elements in a comment of the file’s language.

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