no-raw-special-elements
Angular templatesHTMLVue / SvelteVue / Sveltesuspiciousno fixdefault: warnhtml/eslint-plugin-svelte-recommended
What it does
Section titled “What it does”Reports <head>, <body>, <window>, <document>, <element> and <options>, which are plain elements in Svelte.
Why it matters
Section titled “Why it matters”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>.
Example
Section titled “Example”<head></head><svelte:head><title>t</title></svelte:head>...<head></head><svelte:head><title>t</title></svelte:head>...Configuration
Section titled “Configuration”angular: lint: rules: no-raw-special-elements: warn # off, warn (default), errorhtml: lint: rules: no-raw-special-elements: warn # off, warn (default), errorsvelte: lint: rules: no-raw-special-elements: warn # off, warn (default), errorvue: lint: rules: no-raw-special-elements: warn # off, warn (default), errorEnabled 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.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| eslint-plugin-svelte | no-raw-special-elements |
full |