Skip to content

Commit 8492dbe

Browse files
authored
docs(eslint-plugin-react-hooks): document React Compiler rule
1 parent 99fd4f2 commit 8492dbe

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

packages/eslint-plugin-react-hooks/README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# `eslint-plugin-react-hooks`
22

3-
This ESLint plugin enforces the [Rules of Hooks](https://react.dev/reference/rules/rules-of-hooks).
3+
This ESLint plugin:
44

5-
It is a part of the [Hooks API](https://react.dev/reference/react/hooks) for React.
5+
- reports violations of the [Rules of Hooks](https://react.dev/reference/rules/rules-of-hooks)
6+
- reports React code problematic for the React compiler
67

78
## Installation
89

@@ -33,6 +34,21 @@ export default [
3334
];
3435
```
3536

37+
Optionally, enable the React compiler rule:
38+
39+
```js
40+
import * as reactHooks from 'eslint-plugin-react-hooks';
41+
42+
export default [
43+
reactHooks.configs.recommended,
44+
{
45+
rules: {
46+
'react-hooks/react-compiler': 'error',
47+
},
48+
},
49+
];
50+
```
51+
3652
#### 5.2.0
3753

3854
For users of 5.2.0 (the first version with flat config support), add the `recommended-latest` config.

0 commit comments

Comments
 (0)