require-doctype

This rule enforces to use <!DOCTYPE html> in the document.

How to use

.eslintrc.js
module.exports = {
  rules: {
    "@html-eslint/require-doctype": "error",
  },
};

Rule Details

Examples of incorrect code for this rule:

<html></html>

Examples of correct code for this rule:

<!DOCTYPE html>
<html></html>

Further Reading

  1. MDN - Doctype