Skip to content

Commit

Permalink
fix(eslint-plugin): fix legacy recommended config (#8104)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins authored Sep 27, 2024
1 parent a9e83a4 commit ade6283
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/eslint/eslint-plugin-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ export default [

### Recommended setup

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

```json
{
"extends": ["plugin:@tanstack/eslint-plugin-query/recommended"]
"extends": ["plugin:@tanstack/query/recommended"]
}
```

### Custom setup

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

```json
{
Expand Down
7 changes: 0 additions & 7 deletions examples/react/algolia/.eslintrc

This file was deleted.

19 changes: 19 additions & 0 deletions examples/react/algolia/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { tanstackConfig } from '@tanstack/config/eslint'
import pluginQuery from '@tanstack/eslint-plugin-query'
import pluginReact from '@eslint-react/eslint-plugin'
import pluginReactHooks from 'eslint-plugin-react-hooks'

export default [
...tanstackConfig,
...pluginQuery.configs['flat/recommended'],
pluginReact.configs.recommended,
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
},
},
]
2 changes: 1 addition & 1 deletion packages/eslint-plugin-query/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const plugin: Plugin = {
// Assign configs here so we can reference `plugin`
Object.assign(plugin.configs, {
recommended: {
plugins: ['@tanstack/eslint-plugin-query'],
plugins: ['@tanstack/query'],
rules: {
'@tanstack/query/exhaustive-deps': 'error',
'@tanstack/query/no-rest-destructuring': 'warn',
Expand Down

0 comments on commit ade6283

Please sign in to comment.