add tanstack query eslint plugin

This commit is contained in:
Samuel Newman
2026-04-02 16:49:12 +03:00
parent eb566c5fcc
commit c131662299
3 changed files with 32 additions and 1 deletions
+23
View File
@@ -14,6 +14,7 @@ import lingui from 'eslint-plugin-lingui'
import reactCompiler from 'eslint-plugin-react-compiler'
import bskyInternal from 'eslint-plugin-bsky-internal'
import globals from 'globals'
import pluginQuery from '@tanstack/eslint-plugin-query'
import tsParser from '@typescript-eslint/parser'
export default defineConfig(
@@ -65,6 +66,9 @@ export default defineConfig(
lingui,
'react-compiler': reactCompiler,
'bsky-internal': bskyInternal,
// @ts-expect-error - not sure why
'@tanstack/query': pluginQuery,
},
languageOptions: {
ecmaVersion: 'latest',
@@ -255,6 +259,25 @@ export default defineConfig(
'no-sparse-arrays': 'off',
'no-fallthrough': 'off',
'no-control-regex': 'off',
/**
* React Query
*/
'@tanstack/query/no-rest-destructuring': 'error',
'@tanstack/query/stable-query-client': 'error',
'@tanstack/query/no-unstable-deps': 'error',
'@tanstack/query/infinite-query-property-order': 'error',
'@tanstack/query/no-void-query-fn': 'error',
'@tanstack/query/mutation-property-order': 'error',
'@tanstack/query/prefer-query-options': 'off',
'@tanstack/query/exhaustive-deps': [
'off', // consider changing to warn, but very noisy
{
'allowlist': {
'variables': ['agent', 'ax', 'queryClient', 'moderationOpts'],
}
}
],
},
},