Skip to content

Commit 47449b7

Browse files
authored
docs: Update eslint-plugin-query.md (#6306)
TK Mentioned that the docs would be easier to change if the recommended config was above the alternative config.
1 parent b3c7dba commit 47449b7

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

docs/react/eslint/eslint-plugin-query.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,32 @@ $ yarn add -D @tanstack/eslint-plugin-query
1919

2020
## Usage
2121

22-
Add `@tanstack/eslint-plugin-query` to the plugins section of your `.eslintrc` configuration file:
22+
To enable all of the recommended rules for our plugin, add `plugin:@tanstack/eslint-plugin-query/recommended` in extends:
2323

2424
```json
2525
{
26-
"plugins": ["@tanstack/query"]
26+
"extends": ["plugin:@tanstack/eslint-plugin-query/recommended"]
2727
}
2828
```
2929

30-
Then configure the rules you want to use under the rules section:
30+
31+
### Alternative config
32+
33+
Alternatively, add `@tanstack/eslint-plugin-query` to the plugins section of your `.eslintrc` configuration file:
3134

3235
```json
3336
{
34-
"rules": {
35-
"@tanstack/query/exhaustive-deps": "error",
36-
"@tanstack/query/stable-query-client": "error"
37-
}
37+
"plugins": ["@tanstack/query"]
3838
}
3939
```
4040

41-
### Recommended config
42-
43-
You can also enable all the recommended rules for our plugin. Add `plugin:@tanstack/eslint-plugin-query/recommended` in extends:
41+
Then configure the rules you want to use under the rules section:
4442

4543
```json
4644
{
47-
"extends": ["plugin:@tanstack/eslint-plugin-query/recommended"]
45+
"rules": {
46+
"@tanstack/query/exhaustive-deps": "error",
47+
"@tanstack/query/stable-query-client": "error"
48+
}
4849
}
4950
```

0 commit comments

Comments
 (0)