Skip to content

htmlLangs

Reports <html> elements without a lang prop.

✅ This rule is included in the jsx logical preset.

The lang attribute on the <html> element identifies the language of the document for screen readers and assistive technologies. Without it, screen readers may default to the user’s system language, causing confusion for users.

This is required for WCAG 3.1.1 compliance.

<html>
<body>Content</body>
</html>
<html className="root">
<body>Content</body>
</html>

If you’re not working with HTML documents or the <html> element is managed by a framework, you can disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.