O with occluded right edge to appear also as a C Open Web Components Guides Docs Blog Toggle darkmode

EsLint Plugin Lit A11y: valid-lang

Enforce the lang attribute on the html element. The lang attribute will only be populated with a value that's BCP 47 compliant

Rule Details

This rule aims to ensure HTML content is WCAG 3.1.1 compliant.

Examples of incorrect code for this rule:

html` <html></html> `;
html` <html lang="not-a-real-language"></html> `;

Examples of correct code for this rule:

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

Further Reading

MDN: lang