# doctype-html5

> Ensures the doctype is HTML5.

Doctype must be HTML5.

Level: Warning

## Config value

[Section titled “Config value”](#config-value)

* `true`: enable rule
* `false`: disable rule

### The following pattern is **not** considered a rule violations

[Section titled “The following pattern is not considered a rule violations”](#the-following-pattern-is-not-considered-a-rule-violations)

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

### The following pattern is considered a rule violation:

[Section titled “The following pattern is considered a rule violation:”](#the-following-pattern-is-considered-a-rule-violation)

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

## Why this rule is important

[Section titled “Why this rule is important”](#why-this-rule-is-important)

The DOCTYPE declaration is required for HTML5 compliance and to ensure that the document is parsed correctly.

Further reading: [MDN Web Docs - Doctype](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)