Migrating from eslint-plugin-react-hooks
Complete guide for migrating from eslint-plugin-react-hooks to ESLint React
This guide provides a comprehensive comparison between eslint-plugin-react-hooks and ESLint React rules to help you migrate your existing configuration.
Overview
ESLint React provides direct equivalents for the core rules in eslint-plugin-react-hooks, including both the classic hooks linting rules (exhaustive-deps, rules-of-hooks) and many of the newer React Compiler diagnostic rules introduced in the latest versions of the plugin.
Rules specific to the React Compiler runtime (such as config, gating, globals, incompatible-library, and preserve-manual-memoization) do not have equivalents in ESLint React, as they validate compiler-specific configuration and behavior.
Rule Comparison Table
Legend
- ๐ง Fully supported - Rule is supported, and has an auto-fix
- โ Mostly supported - Rule is supported but doesn't have an auto-fix
- ๐ก Partial support - Similar but not identical functionality
- ๐งช Experimental - Rule is supported but marked as experimental
- โ Not supported - No equivalent rule
Table
The following table compares all rules from eslint-plugin-react-hooks with their ESLint React equivalents:
eslint-plugin-react-hooks Rule Name | New Rule Name | Prev Status | Status |
|---|---|---|---|
exhaustive-deps | exhaustive-deps | โ | ๐ง |
rules-of-hooks | rules-of-hooks | โ | ๐ง |
component-hook-factories | component-hook-factories | โ | โ |
config | โ | โ | |
error-boundaries | error-boundaries | โ | โ |
gating | โ | โ | |
globals | โ | โ | |
immutability | immutability | โ | ๐ก ๐งช |
incompatible-library | โ | โ | |
preserve-manual-memoization | โ | โ | |
purity | purity | โ | ๐ก ๐งช |
refs | refs | โ | ๐ก ๐งช |
set-state-in-effect | set-state-in-effect | โ | โ |
set-state-in-render | set-state-in-render | โ | ๐งช |
static-components | no-nested-component-definitions | โ | โ |
unsupported-syntax | unsupported-syntax | โ | โ |
use-memo | use-memo | โ | โ |
ESLint React Column
- Rule names link to ESLint React documentation
- Multiple rules separated by
+indicate that together they provide equivalent functionality - Rules marked ๐งช are experimental and their behavior may change in future releases
- Rules marked โ are React Compiler-specific and have no equivalent in ESLint React