DOCTYPE declaration

Warns when doesn't declare DOCTYPE. Also warns when declared obsolete type.

Rule Details

👎 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>

Setting value

Type: "always"

valuedefaultdescription
"always"Warns when doesn't declare DOCTYPE. Ignore when document is fragment.

Options

denyObsolateType

Type: boolean

valuedefaultdescription
trueWarns that the type is not <!doctype html>.
falseAllow any type.

Default severity

error