Skip to content

Commit 15023c8

Browse files
docs(eslint-plugin-react-hooks): clarify compiler-powered rule availability and presets
1 parent 11cb6b5 commit 15023c8

File tree

1 file changed

+6
-2
lines changed
  • src/content/reference/eslint-plugin-react-hooks

1 file changed

+6
-2
lines changed

src/content/reference/eslint-plugin-react-hooks/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ version: rc
1212
This plugin helps you catch violations of React's rules at build time, ensuring your components and hooks follow React's rules for correctness and performance. The lints cover both fundamental React patterns (exhaustive-deps and rules-of-hooks) and issues flagged by React Compiler. React Compiler diagnostics are automatically surfaced by this ESLint plugin, and can be used even if your app hasn't adopted the compiler yet.
1313

1414
<Note>
15-
When the compiler reports a diagnostic, it means that the compiler was able to statically detect a pattern that is not supported or breaks the Rules of React. When it detects this, it **automatically** skips over those components and hooks, while keeping the rest of your app compiled. This ensures optimal coverage of safe optimizations that won't break your app.
15+
**Clarification (updated):**
16+
Compiler-powered rules are available starting in `[email protected]` — but they are **not** included in the default `recommended` preset. If you want the compiler-powered rules, enable the `recommended-latest` preset or install `eslint-plugin-react-compiler` separately depending on your setup.
1617

17-
What this means for linting, is that you don’t need to fix all violations immediately. Address them at your own pace to gradually increase the number of optimized components.
18+
Example: to opt into compiler-powered rules, add the `recommended-latest` preset to your ESLint config, or include the `eslint-plugin-react-compiler` plugin directly if you prefer explicit control.
19+
20+
Refer to the plugin changelog and the recommended presets for the most up-to-date instructions.
1821
</Note>
1922

23+
2024
## Recommended Rules {/*recommended*/}
2125

2226
These rules are included in the `recommended` preset `eslint-plugin-react-hooks`:

0 commit comments

Comments
 (0)