Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.15 KB

File metadata and controls

36 lines (28 loc) · 1.15 KB
description Modern alternatives to the eslint-plugin-react package for React/JSX-specific linting rules

Replacements for eslint-plugin-react

@eslint-react/eslint-plugin

@eslint-react/eslint-plugin is not a drop-in replacement, but a feature‑rich alternative that covers many of the same (and additional) rules.

Flat config example:

import eslintReact from '@eslint-react/eslint-plugin' // [!code ++]
import reactPlugin from 'eslint-plugin-react' // [!code --]

export default [
  {
    files: ['**/*.{jsx,tsx}'],
    plugins: {
      react: reactPlugin, // [!code --]
      '@eslint-react': eslintReact // [!code ++]
    },
    rules: {
      ...reactPlugin.configs.recommended.rules, // [!code --]
      ...eslintReact.configs.recommended.rules, // [!code ++]

      'react/no-unknown-property': 'error', // [!code --]
      '@eslint-react/dom/no-unknown-property': 'error' // [!code ++]
    }
  }
]

Note

@eslint-react/eslint-plugin is not a drop‑in replacement. Use their migration guide to map rules/options and automate changes where possible.