Skip to content

Replacements for eslint-plugin-jsx-a11y ​

eslint-plugin-jsx-a11y still supports very old ESLint and Node versions, which pulls in far more dependencies than it needs.

eslint-plugin-jsx-a11y-x ​

eslint-plugin-jsx-a11y-x is a fork of eslint-plugin-jsx-a11y with far fewer dependencies and full support for flat config and ESLint v10.

NOTE

eslint-plugin-jsx-a11y-x is still being modernised, so treat it as experimental for now.

Rename the import, use configs instead of flatConfigs, and change the rule prefix from jsx-a11y/ to jsx-a11y-x/:

ts
import jsxA11y from 'eslint-plugin-jsx-a11y'
import jsxA11yX from 'eslint-plugin-jsx-a11y-x'

export default [
  {
    files: ['**/*.{jsx,tsx}'],
    ...jsxA11y.flatConfigs.recommended, 
    ...jsxA11yX.configs.recommended, 
    rules: {
      ...jsxA11y.flatConfigs.recommended.rules, 
      ...jsxA11yX.configs.recommended.rules, 
      'jsx-a11y/no-autofocus': 'off', 
      'jsx-a11y-x/no-autofocus': 'off'
    },
    settings: {
      'jsx-a11y': { components: { Image: 'img' } }, 
      'jsx-a11y-x': { components: { Image: 'img' } } 
    }
  }
]

NOTE

Settings under the old jsx-a11y key are ignored without a warning, so make sure to rename that key too. The deprecated accessible-emoji, label-has-for and no-onchange rules no longer exist and should be removed. See the migration notes for the full list.

Oxlint ​

Oxlint is a high-performance linter for JavaScript and TypeScript, built on the Rust-based Oxc compiler stack. It has ported all of the non-deprecated eslint-plugin-jsx-a11y rules.

The migration process from ESLint is covered in the Oxlint documentation, and can be done automatically from an ESLint flat config using npx @oxlint/migrate.

Released under the MIT License. (2b9c3f42)