Skip to main content

doctype

Warns when doesn't including DOCTYPE. Also warns when included obsolete type.

❌ Examples of incorrect code for this rule

<html>
<head>
<title>Any Page</title>
</head>
<body>
<h1>Any Page</h1>
<p>Anonymous</p>
</body>
</html>

✅ Examples of correct code for this rule

<!doctype html>
<html>
<head>
<title>Any Page</title>
</head>
<body>
<h1>Any Page</h1>
<p>Anonymous</p>
</body>
</html>

Interface

{
"doctype": "always"
}
ValueDefaultDescription
"always"Warns when doesn't declare Doctype. Ignore when document is fragment.

Options

{
"doctype": {
"options": {
"denyObsoleteType"?: boolean
}
}
}
PropertyTypeDefault ValueDescription
denyObsoleteTypeboolean"true"Warns that the type is not <!doctype html>.

Default Severity

error