Skip to content

Commit ade6283

Browse files
fix(eslint-plugin): fix legacy recommended config (#8104)
1 parent a9e83a4 commit ade6283

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

docs/eslint/eslint-plugin-query.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ export default [
7070

7171
### Recommended setup
7272

73-
To enable all of the recommended rules for our plugin, add `plugin:@tanstack/eslint-plugin-query/recommended` in extends:
73+
To enable all of the recommended rules for our plugin, add `plugin:@tanstack/query/recommended` in extends:
7474

7575
```json
7676
{
77-
"extends": ["plugin:@tanstack/eslint-plugin-query/recommended"]
77+
"extends": ["plugin:@tanstack/query/recommended"]
7878
}
7979
```
8080

8181
### Custom setup
8282

83-
Alternatively, add `@tanstack/eslint-plugin-query` to the plugins section, and configure the rules you want to use:
83+
Alternatively, add `@tanstack/query` to the plugins section, and configure the rules you want to use:
8484

8585
```json
8686
{

examples/react/algolia/.eslintrc

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { tanstackConfig } from '@tanstack/config/eslint'
2+
import pluginQuery from '@tanstack/eslint-plugin-query'
3+
import pluginReact from '@eslint-react/eslint-plugin'
4+
import pluginReactHooks from 'eslint-plugin-react-hooks'
5+
6+
export default [
7+
...tanstackConfig,
8+
...pluginQuery.configs['flat/recommended'],
9+
pluginReact.configs.recommended,
10+
{
11+
plugins: {
12+
'react-hooks': pluginReactHooks,
13+
},
14+
rules: {
15+
'react-hooks/exhaustive-deps': 'error',
16+
'react-hooks/rules-of-hooks': 'error',
17+
},
18+
},
19+
]

packages/eslint-plugin-query/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const plugin: Plugin = {
2323
// Assign configs here so we can reference `plugin`
2424
Object.assign(plugin.configs, {
2525
recommended: {
26-
plugins: ['@tanstack/eslint-plugin-query'],
26+
plugins: ['@tanstack/query'],
2727
rules: {
2828
'@tanstack/query/exhaustive-deps': 'error',
2929
'@tanstack/query/no-rest-destructuring': 'warn',

0 commit comments

Comments
 (0)