This rule enforces lang attribute at <html> tag.


The lang attribute in the HTML tag (<html>) is used to declare the language of the document. This attribute is important for accessibility and helps browsers, search engines, and other software understand the language of the content.

How to use

module.exports = {
  rules: {
    "@html-eslint/require-lang": "error",

Rule Details

Examples of incorrect code for this rule:


<html lang="">

Examples of correct code for this rule:

<html lang="ko">

Further Reading

  1. MDN: lang