Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8abc202

Browse files
jdeniaugaearon
andauthored
[eslint-plugin-react-hooks] Prefer recommended eslint configuration (facebook#18951)
* [eslint-plugin-react-hooks] Prefer recommended eslint configuration * Update README.md Co-authored-by: Dan Abramov <[email protected]>
1 parent 4821d60 commit 8abc202

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,20 @@ npm install eslint-plugin-react-hooks --save-dev
1818
yarn add eslint-plugin-react-hooks --dev
1919
```
2020

21-
Then add it to your ESLint configuration:
21+
Then extend the recommended eslint config:
22+
23+
```js
24+
{
25+
"extends": [
26+
// ...
27+
"plugin:react-hooks/recommended"
28+
]
29+
}
30+
```
31+
32+
### Custom Configuration
33+
34+
If you want more fine-grained configuration, you can instead add a snippet like this to your ESLint configuration file:
2235

2336
```js
2437
{
@@ -34,16 +47,6 @@ Then add it to your ESLint configuration:
3447
}
3548
```
3649

37-
Or use the recommended config:
38-
39-
```js
40-
{
41-
"extends": [
42-
// ...
43-
"plugin:react-hooks/recommended"
44-
]
45-
}
46-
```
4750

4851
## Valid and Invalid Examples
4952

0 commit comments

Comments
 (0)