src/content/docs/linter/rules/use-valid-lang.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JSX and TSX" icon="seti:javascript"> ## Summary - Rule available since: `v1.0.0` - Diagnostic Category: [`lint/a11y/useValidLang`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule doesn't have a fix. - The default severity of this rule is [**error**](/reference/diagnostics#error). - Sources: - Same as [`jsx-a11y/lang`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/lang.md){
"linter": {
"rules": {
"a11y": {
"useValidLang": "error"
}
}
}
}
Ensure that the attribute passed to the lang attribute is a correct ISO language and/or country.
<html lang="lorem" />
<html lang="en-babab" />
<html lang="en-GB-typo" />
<Html lang="en-babab" />
{
"linter": {
"rules": {
"a11y": {
"useValidLang": "error"
}
}
}
}
Ensure that the attribute passed to the lang attribute is a correct ISO language and/or country.
<html lang="lorem" />
<html lang="en-babab" />
<html lang="en-GB-typo" />
<html lang="en-GB" />