Skip to content

no-raw-special-elements

Reports <head>, <body>, <window>, <document>, <element> and <options>, which are plain elements in Svelte.

The special ones are <svelte:head>, <svelte:body> and so on; a plain <head> is just an unknown element in the component, so the content does not go where the author meant.

To fix, write <svelte:name>.

Reported
<head></head>
<svelte:head><title>t</title></svelte:head>
...
After the fix
<head></head>
<svelte:head><title>t</title></svelte:head>
...
angular:
lint:
rules:
no-raw-special-elements: warn # off, warn (default), error
html:
lint:
rules:
no-raw-special-elements: warn # off, warn (default), error
svelte:
lint:
rules:
no-raw-special-elements: warn # off, warn (default), error
vue:
lint:
rules:
no-raw-special-elements: warn # off, warn (default), error

Enabled by the presets: html/eslint-plugin-svelte-recommended.

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

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

Tool Rule Match
eslint-plugin-svelte no-raw-special-elements full