useValidLang
诊断类别:lint/a11y/useValidLang
¥Diagnostic Category: lint/a11y/useValidLang
自从:v1.0.0
¥Since: v1.0.0
来源:
¥Sources:
-
与以下相同:
jsx-a11y/lang
¥Same as:
jsx-a11y/lang
确保传递给 lang
属性的属性是正确的 ISO 语言和/或国家/地区。
¥Ensure that the attribute passed to the lang
attribute is a correct ISO language and/or country.
¥Examples
¥Invalid
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
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
code-block.jsx:1:12 lint/a11y/useValidLang ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Provide a valid value for the lang attribute.
> 1 │ <html lang=“en-GB-typo” />
│ ^^^^^^^^^^^^
2 │
¥Valid
¥Related links