Skip to main content

html-lang-require

The lang attribute of an <html> element must be present and should be valid.

Level: warning

Config value

  1. true: enable rule
  2. false: disable rule

The following pattern are not considered rule violations:

<html lang="en"></html>

The following patterns are considered a rule violations:

<!-- missing lang tag -->
<html></html>
<!-- empty lang tag -->
<html lang=""></html>
<!-- invalid BCP 47 lang value -->
<html lang="-"></html>