missing-doctype
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: offhtml/htmlhinthtml/html-eslint-recommended
What it does
Section titled “What it does”Reports a document that has no doctype, on its start. Not in .vue, .svelte and *.component.html files, which are fragments of a page.
Why it matters
Section titled “Why it matters”A document with no doctype is rendered in quirks mode, which keeps old browser layout bugs alive and changes how boxes and tables are sized.
To fix, put <!DOCTYPE html> on the first line.
Example
Section titled “Example”<title>x</title>Configuration
Section titled “Configuration”angular: lint: rules: missing-doctype: warn # off (default), warn, errorhtml: lint: rules: missing-doctype: warn # off (default), warn, errorsvelte: lint: rules: missing-doctype: warn # off (default), warn, errorvue: lint: rules: missing-doctype: warn # off (default), warn, errorEnabled by the presets: html/htmlhint, html/html-eslint-recommended.
Suppress one line with sudsy-disable-next-line missing-doctype in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”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-eslint | require-doctype |
full | |
| html-validate | missing-doctype |
full | |
| htmlhint | doctype-first |
partial | the doctype is not required to be the first thing in the file |