Skip to content

htmlLangs

Reports <html> elements without a lang prop.

✅ This rule is included in the jsx logical and logicalStrict presets.

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.

<
any
html
>
<
any
body
>Content</
any
body
>
</
any
html
>
<
any
html
className: string
className
="root">
<
any
body
>Content</
any
body
>
</
any
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 ❤️‍🔥 around the world by the Flint team and contributors.