useValidLang
Diagnostic Category: lint/a11y/useValidLang
Since: v1.0.0
Sources:
- Same as: 
jsx-a11y/lang 
Description
Section titled DescriptionEnsure that the attribute passed to the lang attribute is a correct ISO language and/or country.
Examples
Section titled ExamplesInvalid
Section titled Invalid<html lang="lorem" />code-block.jsx:1:12 lint/a11y/useValidLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Provide a valid value for the lang attribute.
  
  > 1 │ <html lang=“lorem” />
      │            ^^^^^^^
    2 │ 
  
  ℹ Some of valid languages:
  
  - ab
  - aa
  - af
  - sq
  - am
  - ar
  - an
  - hy
  - as
  - ay
  - az
  - ba
  - eu
  - bn
  - dz
  
<html lang="en-babab" />code-block.jsx:1:12 lint/a11y/useValidLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Provide a valid value for the lang attribute.
  
  > 1 │ <html lang=“en-babab” />
      │            ^^^^^^^^^^
    2 │ 
  
  ℹ Some of valid countries:
  
  - AF
  - AL
  - DZ
  - AS
  - AD
  - AO
  - AI
  - AQ
  - AG
  - AR
  - AM
  - AW
  - AU
  - AT
  - AZ
  
<html lang="en-GB-typo" />code-block.jsx:1:12 lint/a11y/useValidLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Provide a valid value for the lang attribute.
  
  > 1 │ <html lang=“en-GB-typo” />
      │            ^^^^^^^^^^^^
    2 │ 
  
Valid
Section titled Valid<Html lang="en-babab" />How to configure
Section titled How to configure{  "linter": {    "rules": {      "a11y": {        "useValidLang": "error"      }    }  }}