Skip to content

Commit 76d7fba

Browse files
committed
add lint v6
1 parent 29d31a0 commit 76d7fba

17 files changed

+67
-87
lines changed

src/content/blog/2025/10/01/react-19-2.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,23 @@ This is because Node Streams are much faster than Web Streams in Node, and Web S
287287
288288
---
289289
290+
### `eslint-plugin-react-hooks` v6 {/*eslint-plugin-react-hooks*/}
291+
292+
We also published `eslint-plugin-react-hooks@6.1.0` with flat config by default in the `recommended` preset, and opt-in for new React Compiler powered rules.
293+
294+
To continue using the legacy config, you can change to `recommended-legacy`:
295+
296+
```diff
297+
- extends: ['plugin:react-hooks/recommended']
298+
+ extends: ['plugin:react-hooks/recommended-legacy']
299+
```
300+
301+
For a full list of compiler enabled rules, [check out the linter docs](/reference/eslint-plugin-react-hooks#available-lints).
302+
303+
Check out the `eslint-plugin-react-hooks` [changelog for a full list of changes](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/CHANGELOG.md#610).
304+
305+
---
306+
290307
### Update the default `useId` prefix {/*update-the-default-useid-prefix*/}
291308
292309
In 19.2, we're updating the default `useId` prefix from `:r:` (19.0.0) or `«r»` (19.1.0) to `_r_`.

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ version: rc
99

1010
</Intro>
1111

12-
<RC>
13-
14-
These docs include rules available in the RC version of `eslint-plugin-react-hooks`.
15-
16-
You can try them by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).
17-
18-
</RC>
19-
2012
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.
2113

2214
<Note>
@@ -25,14 +17,16 @@ When the compiler reports a diagnostic, it means that the compiler was able to s
2517
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.
2618
</Note>
2719

28-
## Available Lints {/*available-lints*/}
20+
## Recommended Rules {/*recommended*/}
2921

30-
These rules are available in the stable version of `eslint-plugin-react-hooks`:
22+
These rules are included in the `recommended` preset `eslint-plugin-react-hooks`:
3123

3224
* [`exhaustive-deps`](/reference/eslint-plugin-react-hooks/lints/exhaustive-deps) - Validates that dependency arrays for React hooks contain all necessary dependencies
3325
* [`rules-of-hooks`](/reference/eslint-plugin-react-hooks/lints/rules-of-hooks) - Validates that components and hooks follow the Rules of Hooks
3426

35-
These rules are available in the RC version of `eslint-plugin-react-hooks`:
27+
## Additional Rules {/*additional-rules*/}
28+
29+
Starting in version 6.0, these rules are available to opt-in:
3630

3731
* [`component-hook-factories`](/reference/eslint-plugin-react-hooks/lints/component-hook-factories) - Validates higher order functions defining nested components or hooks
3832
* [`config`](/reference/eslint-plugin-react-hooks/lints/config) - Validates the compiler configuration options

src/content/reference/eslint-plugin-react-hooks/lints/component-hook-factories.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: component-hook-factories
3-
version: rc
43
---
54

65
<Intro>
@@ -9,13 +8,11 @@ Validates against higher order functions defining nested components or hooks. Co
98

109
</Intro>
1110

12-
<RC>
11+
<Note>
1312

14-
This rule is available in the RC version of `eslint-plugin-react-hooks`.
13+
This rule is available in `eslint-plugin-react-hooks` v6.
1514

16-
You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).
17-
18-
</RC>
15+
</Note>
1916

2017
## Rule Details {/*rule-details*/}
2118

src/content/reference/eslint-plugin-react-hooks/lints/config.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ Validates the compiler [configuration options](/reference/react-compiler/configu
99

1010
</Intro>
1111

12-
<RC>
12+
<Note>
1313

14-
This rule is available in the RC version of `eslint-plugin-react-hooks`.
14+
This rule is available in `eslint-plugin-react-hooks` v6.
1515

16-
You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).
17-
18-
</RC>
16+
</Note>
1917

2018
## Rule Details {/*rule-details*/}
2119

src/content/reference/eslint-plugin-react-hooks/lints/error-boundaries.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ Validates usage of Error Boundaries instead of try/catch for errors in child com
99

1010
</Intro>
1111

12-
<RC>
12+
<Note>
1313

14-
This rule is available in the RC version of `eslint-plugin-react-hooks`.
14+
This rule is available in `eslint-plugin-react-hooks` v6.
1515

16-
You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).
17-
18-
</RC>
16+
</Note>
1917

2018
## Rule Details {/*rule-details*/}
2119

src/content/reference/eslint-plugin-react-hooks/lints/gating.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ Validates configuration of [gating mode](/reference/react-compiler/gating).
99

1010
</Intro>
1111

12-
<RC>
12+
<Note>
1313

14-
This rule is available in the RC version of `eslint-plugin-react-hooks`.
14+
This rule is available in `eslint-plugin-react-hooks` v6.
1515

16-
You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).
17-
18-
</RC>
16+
</Note>
1917

2018
## Rule Details {/*rule-details*/}
2119

src/content/reference/eslint-plugin-react-hooks/lints/globals.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ Validates against assignment/mutation of globals during render, part of ensuring
99

1010
</Intro>
1111

12-
<RC>
12+
<Note>
1313

14-
This rule is available in the RC version of `eslint-plugin-react-hooks`.
14+
This rule is available in `eslint-plugin-react-hooks` v6.
1515

16-
You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).
17-
18-
</RC>
16+
</Note>
1917

2018
## Rule Details {/*rule-details*/}
2119

src/content/reference/eslint-plugin-react-hooks/lints/immutability.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ Validates against mutating props, state, and other values that [are immutable](/
99

1010
</Intro>
1111

12-
<RC>
12+
<Note>
1313

14-
This rule is available in the RC version of `eslint-plugin-react-hooks`.
14+
This rule is available in `eslint-plugin-react-hooks` v6.
1515

16-
You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).
17-
18-
</RC>
16+
</Note>
1917

2018
## Rule Details {/*rule-details*/}
2119

src/content/reference/eslint-plugin-react-hooks/lints/incompatible-library.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ Validates against usage of libraries which are incompatible with memoization (ma
99

1010
</Intro>
1111

12-
<RC>
13-
14-
This rule is available in the RC version of `eslint-plugin-react-hooks`.
12+
<Note>
1513

16-
You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).
14+
This rule is available in `eslint-plugin-react-hooks` v6.
1715

18-
</RC>
16+
</Note>
1917

2018
<Note>
2119

src/content/reference/eslint-plugin-react-hooks/lints/preserve-manual-memoization.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ Validates that existing manual memoization is preserved by the compiler. React C
99

1010
</Intro>
1111

12-
<RC>
12+
<Note>
1313

14-
This rule is available in the RC version of `eslint-plugin-react-hooks`.
14+
This rule is available in `eslint-plugin-react-hooks` v6.
1515

16-
You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).
17-
18-
</RC>
16+
</Note>
1917

2018
## Rule Details {/*rule-details*/}
2119

0 commit comments

Comments
 (0)