跳转到内容

useValidLang

Diagnostic Category: lint/a11y/useValidLang

Since: v1.0.0

Sources:

Ensure that the attribute passed to the lang attribute is a correct ISO language and/or country.

<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 │

<Html lang="en-babab" />