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.

CE6htCd ivclassNa="meec-li">nt< sp ansty="le--1:#8844">CE6boCsp ansty="le--0:#D6DEEB;--1:#403F">53Contesp>CA<E6boCd>d ivclassNa="meec-li">CA<E6htCd>d ivclassNa="meco">d>d>d>CE6htCB0classNaA1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dro1<1"sp ansty="le--0:#7FDBCA;--1:#8844">Ad ivclassNa="meec-li">nt< sp ansty="le--1:#8844">CE6boCsp ansty="le--0:#D6DEEB;--1:#403F">53Contesp>CA<E6boCd>d ivclassNa="meec-li">CA<E6htCd>d ivclassNa="meco">d>d>d>
<44AE spans="tyle--0:#7F">DECE6D61B04<4AE= spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#ECC48D;--1:#98">4E<4Den spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#7FDBCA;--1:#88">4<4AE >divclass="Nameec-">de<44AE spans="tyle--0:#7F">DECE6D spans="tyle--0:#D6DEEB;--1:#40">3F53Con><44AE spans="tyle--0:#7F">DBECE6D<44AE spans="tyle--0:#7F">DBECE6D<>di vdivclass="Nameexpressive-"><44AE spans="tyle--0:#7F">DECE6D61B04<4AE= spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#ECC48D;--1:#98">4E4De1<111" spans="tyle--0:#7FDBCA;--1:#88">4<4AE >divclass="Nameec-">de<44AE spans="tyle--0:#7F">DECE6D spans="tyle--0:#D6DEEB;--1:#40">3F53Con><44AE spans="tyle--0:#7F">DBECE6D<44AE spans="tyle--0:#7F">DBECE6Ddi><>di vdivclass="Nameexpressive-"><44AE spans="tyle--0:#7F">DECE6D61B04<4AE= spans="tyle--0:#E2817F;--1:#B2">3<834{ spans="tyle--0:#D6DEEB;--1:#40">3F53lang3<834} spans="tyle--0:#7FDBCA;--1:#88">4<4AE >divclass="Nameec-">de<44AE spans="tyle--0:#7F">DECE6D spans="tyle--0:#D6DEEB;--1:#40">3F53Con><44AE spans="tyle--0:#7F">DBECE6D<44AE spans="tyle--0:#7F">DBECE6Ddi>

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