# lang

Rule `jsx-a11y/lang`. Enforce lang attribute has a valid value.

- Source: jsx-a11y
- Technologies: Accessibility, React
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 33.9M weekly downloads of presets that enable it
- Trend: +89.5% last quarter
- Rank: #461 by reach, #299 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `jsx-a11y/lang` | no | no | package `eslint-plugin-jsx-a11y` | [docs](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/lang.md) |
| Oxlint | `jsx-a11y/lang` | no | no | plugin `jsx-a11y`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/lang.html) |
| Biome | `a11y/useValidLang` | yes | no | group a11y, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/use-valid-lang/) |

## Code examples

### Incorrect: the rule reports this

```jsx
<html>
<html lang="foo">
```

### Correct: the rule accepts this

```jsx
<html lang="en">
<html lang="en-US">
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import jsxA11y from "eslint-plugin-jsx-a11y";

export default [
  {
    plugins: { "jsx-a11y": jsxA11y },
    rules: {
      "jsx-a11y/lang": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "jsx-a11y"
  ],
  "rules": {
    "jsx-a11y/lang": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "a11y": {
        "useValidLang": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [jsx-a11y/anchor-ambiguous-text](https://lintradar.dev/rules/jsx-a11y/anchor-ambiguous-text.md): Enforce `<a>` text to not exactly match "click here", "here", "link", or "a link".
- [jsx-a11y/no-aria-hidden-on-focusable](https://lintradar.dev/rules/jsx-a11y/no-aria-hidden-on-focusable.md): Disallow `aria-hidden="true"` from being set on focusable elements.
- [jsx-a11y/prefer-tag-over-role](https://lintradar.dev/rules/jsx-a11y/prefer-tag-over-role.md): Enforces using semantic DOM elements over the ARIA `role` property.
- [jsx-a11y/no-noninteractive-element-interactions](https://lintradar.dev/rules/jsx-a11y/no-noninteractive-element-interactions.md): Non-interactive elements should not be assigned mouse or keyboard event listeners.
- [jsx-a11y/autocomplete-valid](https://lintradar.dev/rules/jsx-a11y/autocomplete-valid.md): Enforce that autocomplete attributes are used correctly.
- [jsx-a11y/no-autofocus](https://lintradar.dev/rules/jsx-a11y/no-autofocus.md): Enforce autoFocus prop is not used.

---

Web page: https://lintradar.dev/rules/jsx-a11y/lang. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
