Skip to main content

no-obsolete-doctype

Warns when a document declares an obsolete DOCTYPE — one with a public identifier, or a system identifier other than the one legacy-string exception the HTML Living Standard still permits.

A missing DOCTYPE entirely is require-doctype's concern, not this rule's.

❌ Examples of incorrect code for this rule

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

✅ Examples of correct code for this rule

<!doctype html>
note

HTML Living Standard §13.1.1 permits exactly one legacy-string form as a conforming exception, used to keep a document shareable with old parsers that require a system identifier:

<!DOCTYPE html SYSTEM "about:legacy-compat">

This rule does not flag it.

Interface

{
"no-obsolete-doctype": boolean
}

Default Severity

error