Require a doctype for the document

Rule ID:
missing-doctype
Category:
Document
Standards:
  • HTML5
Fixable:
Yes

Requires that the document contains a doctype.

Rule details

Examples of incorrect code for this rule:

<html>
  <body>
    ...
  </body>
</html>
error: Document is missing doctype (missing-doctype)
> 1 | <html>
    | ^
  2 |   <body>
  3 |     ...
  4 |   </body>


1 error found.
1 error potentially fixable with the `--fix` option.

Examples of correct code for this rule:

<!doctype html>
<html>
  <body>
    ...
  </body>
</html>