[eslint-plugin-react-hooks] Prefer recommended eslint configuration (#18951)
* [eslint-plugin-react-hooks] Prefer recommended eslint configuration * Update README.md Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Julien Deniau committed
May 27, 2020 at 02:08 UTC
8abc202c7fc73fdfcd9443b00d09d06da4b5cbb1
1 file changed
+14
-11
packages/eslint-plugin-react-hooks/README.md
+14
-11
@@ -18,7 +18,20 @@ npm install eslint-plugin-react-hooks --save-dev
18
yarn add eslint-plugin-react-hooks --dev
19
```
20
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:
35
36
```js
37
{
@@ -34,16 +47,6 @@ Then add it to your ESLint configuration:
47
}
48
```
49
37
-Or use the recommended config:
38
-
39
-```js
40
-{
41
- "extends": [
42
- // ...
43
- "plugin:react-hooks/recommended"
44
- ]
45
-}
46
-```
50
51
## Valid and Invalid Examples
52