Migrating from eslint-plugin-react
Complete guide for migrating from eslint-plugin-react to ESLint React
This guide provides a comprehensive comparison between eslint-plugin-react
and ESLint React rules to help you migrate your existing configuration.
Overview
ESLint React is designed as a modern replacement for eslint-plugin-react
with improved performance, better TypeScript support, and more accurate rule implementations. However, not all rules have direct ✅s, and some behave differently.
Rule Comparison Table
The following table compares all rules from eslint-plugin-react
with their ESLint React equivalents:
Legend
Status Column
- ✅ Fully supported - Rule has a direct equivalent in ESLint React
- 🟡 Partial support - ESLint React provides similar but not identical functionality
- ❌ Not supported - No equivalent rule available in ESLint React
- 🚫 Deprecated - Rule is not applicable in modern React development
- ⚠️ Warning - Rule has been deprecated in eslint-plugin-react
Prev Status Column
- ✅ Standard rule - Original rule provided linting without auto-fix
- 🔧 Fixable rule - Original rule supported automatic fixes
ESLint React Column
- Rule names link to ESLint React documentation
- Multiple rules separated by
/
indicate alternative approaches - Rules with
+
indicate multiple rules that together provide equivalent functionality
Gradual Migration
You can migrate gradually by using both plugins together:
export default [
// Start with ESLint React
{
...eslintReact.configs.recommended,
},
// Add specific eslint-plugin-react rules you still need
{
plugins: {
react: pluginReact,
},
rules: {
"react/jsx-sort-props": "warn", // Example missing rule
},
},
];