Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/content/blog/2025/10/01/react-19-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,23 @@ This is because Node Streams are much faster than Web Streams in Node, and Web S

---

### `eslint-plugin-react-hooks` v6 {/*eslint-plugin-react-hooks*/}

We also published `[email protected]` with flat config by default in the `recommended` preset, and opt-in for new React Compiler powered rules.

To continue using the legacy config, you can change to `recommended-legacy`:

```diff
- extends: ['plugin:react-hooks/recommended']
+ extends: ['plugin:react-hooks/recommended-legacy']
```

For a full list of compiler enabled rules, [check out the linter docs](/reference/eslint-plugin-react-hooks#available-lints).

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).

---

### Update the default `useId` prefix {/*update-the-default-useid-prefix*/}

In 19.2, we're updating the default `useId` prefix from `:r:` (19.0.0) or `«r»` (19.1.0) to `_r_`.
Expand Down
16 changes: 5 additions & 11 deletions src/content/reference/eslint-plugin-react-hooks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ version: rc

</Intro>

<RC>

These docs include rules available in the RC version of `eslint-plugin-react-hooks`.

You can try them by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>

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.

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

## Available Lints {/*available-lints*/}
## Recommended Rules {/*recommended*/}

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

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

These rules are available in the RC version of `eslint-plugin-react-hooks`:
## Additional Rules {/*additional-rules*/}

Starting in version 6.0, these rules are available to opt-in:

* [`component-hook-factories`](/reference/eslint-plugin-react-hooks/lints/component-hook-factories) - Validates higher order functions defining nested components or hooks
* [`config`](/reference/eslint-plugin-react-hooks/lints/config) - Validates the compiler configuration options
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: component-hook-factories
version: rc
---

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

</Intro>

<RC>
<Note>

This rule is available in the RC version of `eslint-plugin-react-hooks`.
This rule is available in `eslint-plugin-react-hooks` v6.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's opt-in, could we tell people what incantation they need to enable?

rules: {
  'react-hooks/component-hook-factories': 'error',
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, but i'm not sure what that looks like for flat config, is it just that?


You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates the compiler [configuration options](/reference/react-compiler/configu

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates usage of Error Boundaries instead of try/catch for errors in child com

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates configuration of [gating mode](/reference/react-compiler/gating).

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates against assignment/mutation of globals during render, part of ensuring

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates against mutating props, state, and other values that [are immutable](/

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates against usage of libraries which are incompatible with memoization (ma

</Intro>

<RC>

This rule is available in the RC version of `eslint-plugin-react-hooks`.
<Note>

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

</RC>
</Note>

<Note>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates that existing manual memoization is preserved by the compiler. React C

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates that [components/hooks are pure](/reference/rules/components-and-hooks

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
8 changes: 3 additions & 5 deletions src/content/reference/eslint-plugin-react-hooks/lints/refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates correct usage of refs, not reading/writing during render. See the "pit

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates against calling setState synchronously in an effect, which can lead to

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates against unconditionally setting state during render, which can trigger

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates that components are static, not recreated every render. Components tha

</Intro>

<RC>

This rule is available in the RC version of `eslint-plugin-react-hooks`.
<Note>

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

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates against syntax that React Compiler does not support. If you need to, y

</Intro>

<RC>

This rule is available in the RC version of `eslint-plugin-react-hooks`.
<Note>

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

</RC>
</Note>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ Validates that the `useMemo` hook is used with a return value. See [`useMemo` do

</Intro>

<RC>
<Note>

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

You can try it by upgrading the lint plugin [to the most recent RC version](/learn/react-compiler/installation#eslint-integration).

</RC>
</Note>

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

Expand Down
Loading