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"
}
Value | Default | Description |
---|---|---|
"always" | ✓ | Warns when doesn't declare Doctype. Ignore when document is fragment. |
Options
{
"doctype": {
"options": {
"denyObsoleteType"?: boolean
}
}
}
Property | Type | Default Value | Description |
---|---|---|---|
denyObsoleteType | boolean | "true" | Warns that the type is not <!doctype html> . |
Default Severity
error