From 46f08591b2d2b13cf6d16988d5d03de3e0715191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Curley?= Date: Thu, 8 Oct 2026 20:49:04 +0100 Subject: [PATCH 1/5] chore: replace eslint with oxlint Lint packages with oxlint (type-aware via oxlint-tsgolint), keeping the existing rule set. Rules oxlint lacks natively run as JS plugins (eslint-plugin-jsdoc, import-x/order, @stylistic, cspell, @eslint-react, react-hooks, solid). no-restricted-syntax and the type parameter naming convention come from a local plugin. Svelte packages keep a slim ESLint config for the svelte/* rules, which need the component template. Co-Authored-By: Claude Opus 5.5 --- eslint.config.js | 165 ------ knip.ts | 6 +- nx.json | 17 +- oxlint.config.ts | 388 +++++++++++++ package.json | 10 +- .../eslint.config.js | 25 - .../oxlint.config.ts | 31 ++ .../angular-query-experimental/package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + .../infinite-query-options.test-d.ts | 8 +- .../src/__tests__/query-options.test-d.ts | 2 +- .../eslint.config.js | 20 - .../oxlint.config.ts | 16 + .../angular-query-persist-client/package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + packages/eslint-plugin-query/eslint.config.js | 21 - packages/eslint-plugin-query/oxlint.config.ts | 17 + packages/eslint-plugin-query/package.json | 2 +- .../eslint-plugin-query/root.eslint.config.js | 1 - .../eslint-plugin-query/root.oxlint.config.ts | 1 + packages/lit-query/eslint.config.js | 14 - packages/lit-query/oxlint.config.ts | 14 + packages/lit-query/package.json | 2 +- packages/lit-query/root.eslint.config.js | 1 - packages/lit-query/root.oxlint.config.ts | 1 + .../preact-query-devtools/eslint.config.js | 24 - .../preact-query-devtools/oxlint.config.ts | 6 + packages/preact-query-devtools/package.json | 4 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + .../eslint.config.js | 24 - .../oxlint.config.ts | 6 + .../preact-query-persist-client/package.json | 4 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + packages/preact-query/eslint.config.js | 30 - packages/preact-query/oxlint.config.ts | 14 + packages/preact-query/package.json | 4 +- packages/preact-query/root.eslint.config.js | 1 - packages/preact-query/root.oxlint.config.ts | 1 + .../__tests__/infiniteQueryOptions.test-d.tsx | 8 +- .../src/__tests__/queryOptions.test-d.tsx | 2 +- .../src/__tests__/useInfiniteQuery.test-d.tsx | 4 +- .../eslint.config.js | 6 - .../oxlint.config.ts | 4 + .../package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + .../eslint.config.js | 6 - .../oxlint.config.ts | 4 + .../package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + packages/query-codemods/eslint.config.js | 26 - packages/query-codemods/oxlint.config.ts | 30 + packages/query-codemods/package.json | 2 +- packages/query-codemods/root.eslint.config.js | 1 - packages/query-codemods/root.oxlint.config.ts | 1 + packages/query-core/eslint.config.js | 6 - packages/query-core/oxlint.config.ts | 4 + packages/query-core/package.json | 2 +- packages/query-core/root.eslint.config.js | 1 - packages/query-core/root.oxlint.config.ts | 1 + .../src/__tests__/queryClient.test-d.tsx | 25 +- .../src/__tests__/queryClient.test.tsx | 68 +-- packages/query-core/src/queryClient.ts | 12 +- packages/query-core/src/streamedQuery.ts | 2 +- packages/query-devtools/eslint.config.js | 6 - packages/query-devtools/oxlint.config.ts | 4 + packages/query-devtools/package.json | 2 +- packages/query-devtools/root.eslint.config.js | 1 - packages/query-devtools/root.oxlint.config.ts | 1 + .../eslint.config.js | 6 - .../oxlint.config.ts | 4 + .../query-persist-client-core/package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + .../eslint.config.js | 6 - .../oxlint.config.ts | 4 + .../query-sync-storage-persister/package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + packages/query-test-utils/eslint.config.js | 6 - packages/query-test-utils/oxlint.config.ts | 4 + packages/query-test-utils/package.json | 2 +- .../query-test-utils/root.eslint.config.js | 1 - .../query-test-utils/root.oxlint.config.ts | 1 + .../react-query-devtools/eslint.config.js | 34 -- .../react-query-devtools/oxlint.config.ts | 42 ++ packages/react-query-devtools/package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + .../eslint.config.js | 35 -- .../oxlint.config.ts | 43 ++ .../package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + .../eslint.config.js | 34 -- .../oxlint.config.ts | 42 ++ .../react-query-persist-client/package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + packages/react-query/eslint.config.js | 40 -- packages/react-query/oxlint.config.ts | 50 ++ packages/react-query/package.json | 2 +- packages/react-query/root.eslint.config.js | 1 - packages/react-query/root.oxlint.config.ts | 1 + .../react-query/src/HydrationBoundary.tsx | 2 +- .../__tests__/infiniteQueryOptions.test-d.tsx | 10 +- .../src/__tests__/queryOptions.test-d.tsx | 4 +- .../src/__tests__/useInfiniteQuery.test-d.tsx | 4 +- packages/react-query/src/__tests__/utils.tsx | 2 +- .../solid-query-devtools/eslint.config.js | 15 - .../solid-query-devtools/oxlint.config.ts | 12 + packages/solid-query-devtools/package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + .../eslint.config.js | 7 - .../oxlint.config.ts | 11 + .../solid-query-persist-client/package.json | 2 +- .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + packages/solid-query/eslint.config.js | 15 - packages/solid-query/oxlint.config.ts | 12 + packages/solid-query/package.json | 2 +- packages/solid-query/root.eslint.config.js | 1 - packages/solid-query/root.oxlint.config.ts | 1 + .../src/__tests__/queryOptions.test-d.tsx | 2 +- .../src/__tests__/useInfiniteQuery.test-d.tsx | 4 +- .../svelte-query-devtools/eslint.config.js | 3 +- .../svelte-query-devtools/oxlint.config.ts | 16 + packages/svelte-query-devtools/package.json | 1 + .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + .../eslint.config.js | 3 +- .../oxlint.config.ts | 16 + .../svelte-query-persist-client/package.json | 1 + .../root.eslint.config.js | 1 - .../root.oxlint.config.ts | 1 + packages/svelte-query/eslint.config.js | 7 +- packages/svelte-query/oxlint.config.ts | 23 + packages/svelte-query/package.json | 1 + packages/svelte-query/root.eslint.config.js | 1 - packages/svelte-query/root.oxlint.config.ts | 1 + .../createInfiniteQuery.test-d.ts | 4 +- .../tests/infiniteQueryOptions.test-d.ts | 2 +- .../svelte-query/tests/queryOptions.test-d.ts | 2 +- packages/vue-query-devtools/eslint.config.js | 7 - packages/vue-query-devtools/oxlint.config.ts | 4 + packages/vue-query-devtools/package.json | 3 +- .../vue-query-devtools/root.eslint.config.js | 1 - .../vue-query-devtools/root.oxlint.config.ts | 1 + packages/vue-query/eslint.config.js | 7 - packages/vue-query/oxlint.config.ts | 4 + packages/vue-query/package.json | 3 +- packages/vue-query/root.eslint.config.js | 1 - packages/vue-query/root.oxlint.config.ts | 1 + .../src/__tests__/queryClient.test-d.ts | 2 +- .../src/__tests__/queryClient.test.ts | 12 +- .../src/__tests__/queryOptions.test-d.ts | 2 +- .../src/__tests__/useMutation.test.ts | 6 +- packages/vue-query/src/queryClient.ts | 10 +- pnpm-lock.yaml | 525 +++++++++++------- pnpm-workspace.yaml | 2 - scripts/oxlint/plugin.ts | 51 ++ tsconfig.json | 1 + 168 files changed, 1375 insertions(+), 972 deletions(-) delete mode 100644 eslint.config.js create mode 100644 oxlint.config.ts delete mode 100644 packages/angular-query-experimental/eslint.config.js create mode 100644 packages/angular-query-experimental/oxlint.config.ts delete mode 120000 packages/angular-query-experimental/root.eslint.config.js create mode 120000 packages/angular-query-experimental/root.oxlint.config.ts delete mode 100644 packages/angular-query-persist-client/eslint.config.js create mode 100644 packages/angular-query-persist-client/oxlint.config.ts delete mode 120000 packages/angular-query-persist-client/root.eslint.config.js create mode 120000 packages/angular-query-persist-client/root.oxlint.config.ts delete mode 100644 packages/eslint-plugin-query/eslint.config.js create mode 100644 packages/eslint-plugin-query/oxlint.config.ts delete mode 120000 packages/eslint-plugin-query/root.eslint.config.js create mode 120000 packages/eslint-plugin-query/root.oxlint.config.ts delete mode 100644 packages/lit-query/eslint.config.js create mode 100644 packages/lit-query/oxlint.config.ts delete mode 120000 packages/lit-query/root.eslint.config.js create mode 120000 packages/lit-query/root.oxlint.config.ts delete mode 100644 packages/preact-query-devtools/eslint.config.js create mode 100644 packages/preact-query-devtools/oxlint.config.ts delete mode 120000 packages/preact-query-devtools/root.eslint.config.js create mode 120000 packages/preact-query-devtools/root.oxlint.config.ts delete mode 100644 packages/preact-query-persist-client/eslint.config.js create mode 100644 packages/preact-query-persist-client/oxlint.config.ts delete mode 120000 packages/preact-query-persist-client/root.eslint.config.js create mode 120000 packages/preact-query-persist-client/root.oxlint.config.ts delete mode 100644 packages/preact-query/eslint.config.js create mode 100644 packages/preact-query/oxlint.config.ts delete mode 120000 packages/preact-query/root.eslint.config.js create mode 120000 packages/preact-query/root.oxlint.config.ts delete mode 100644 packages/query-async-storage-persister/eslint.config.js create mode 100644 packages/query-async-storage-persister/oxlint.config.ts delete mode 120000 packages/query-async-storage-persister/root.eslint.config.js create mode 120000 packages/query-async-storage-persister/root.oxlint.config.ts delete mode 100644 packages/query-broadcast-client-experimental/eslint.config.js create mode 100644 packages/query-broadcast-client-experimental/oxlint.config.ts delete mode 120000 packages/query-broadcast-client-experimental/root.eslint.config.js create mode 120000 packages/query-broadcast-client-experimental/root.oxlint.config.ts delete mode 100644 packages/query-codemods/eslint.config.js create mode 100644 packages/query-codemods/oxlint.config.ts delete mode 120000 packages/query-codemods/root.eslint.config.js create mode 120000 packages/query-codemods/root.oxlint.config.ts delete mode 100644 packages/query-core/eslint.config.js create mode 100644 packages/query-core/oxlint.config.ts delete mode 120000 packages/query-core/root.eslint.config.js create mode 120000 packages/query-core/root.oxlint.config.ts delete mode 100644 packages/query-devtools/eslint.config.js create mode 100644 packages/query-devtools/oxlint.config.ts delete mode 120000 packages/query-devtools/root.eslint.config.js create mode 120000 packages/query-devtools/root.oxlint.config.ts delete mode 100644 packages/query-persist-client-core/eslint.config.js create mode 100644 packages/query-persist-client-core/oxlint.config.ts delete mode 120000 packages/query-persist-client-core/root.eslint.config.js create mode 120000 packages/query-persist-client-core/root.oxlint.config.ts delete mode 100644 packages/query-sync-storage-persister/eslint.config.js create mode 100644 packages/query-sync-storage-persister/oxlint.config.ts delete mode 120000 packages/query-sync-storage-persister/root.eslint.config.js create mode 120000 packages/query-sync-storage-persister/root.oxlint.config.ts delete mode 100644 packages/query-test-utils/eslint.config.js create mode 100644 packages/query-test-utils/oxlint.config.ts delete mode 120000 packages/query-test-utils/root.eslint.config.js create mode 120000 packages/query-test-utils/root.oxlint.config.ts delete mode 100644 packages/react-query-devtools/eslint.config.js create mode 100644 packages/react-query-devtools/oxlint.config.ts delete mode 120000 packages/react-query-devtools/root.eslint.config.js create mode 120000 packages/react-query-devtools/root.oxlint.config.ts delete mode 100644 packages/react-query-next-experimental/eslint.config.js create mode 100644 packages/react-query-next-experimental/oxlint.config.ts delete mode 120000 packages/react-query-next-experimental/root.eslint.config.js create mode 120000 packages/react-query-next-experimental/root.oxlint.config.ts delete mode 100644 packages/react-query-persist-client/eslint.config.js create mode 100644 packages/react-query-persist-client/oxlint.config.ts delete mode 120000 packages/react-query-persist-client/root.eslint.config.js create mode 120000 packages/react-query-persist-client/root.oxlint.config.ts delete mode 100644 packages/react-query/eslint.config.js create mode 100644 packages/react-query/oxlint.config.ts delete mode 120000 packages/react-query/root.eslint.config.js create mode 120000 packages/react-query/root.oxlint.config.ts delete mode 100644 packages/solid-query-devtools/eslint.config.js create mode 100644 packages/solid-query-devtools/oxlint.config.ts delete mode 120000 packages/solid-query-devtools/root.eslint.config.js create mode 120000 packages/solid-query-devtools/root.oxlint.config.ts delete mode 100644 packages/solid-query-persist-client/eslint.config.js create mode 100644 packages/solid-query-persist-client/oxlint.config.ts delete mode 120000 packages/solid-query-persist-client/root.eslint.config.js create mode 120000 packages/solid-query-persist-client/root.oxlint.config.ts delete mode 100644 packages/solid-query/eslint.config.js create mode 100644 packages/solid-query/oxlint.config.ts delete mode 120000 packages/solid-query/root.eslint.config.js create mode 120000 packages/solid-query/root.oxlint.config.ts create mode 100644 packages/svelte-query-devtools/oxlint.config.ts delete mode 120000 packages/svelte-query-devtools/root.eslint.config.js create mode 120000 packages/svelte-query-devtools/root.oxlint.config.ts create mode 100644 packages/svelte-query-persist-client/oxlint.config.ts delete mode 120000 packages/svelte-query-persist-client/root.eslint.config.js create mode 120000 packages/svelte-query-persist-client/root.oxlint.config.ts create mode 100644 packages/svelte-query/oxlint.config.ts delete mode 120000 packages/svelte-query/root.eslint.config.js create mode 120000 packages/svelte-query/root.oxlint.config.ts delete mode 100644 packages/vue-query-devtools/eslint.config.js create mode 100644 packages/vue-query-devtools/oxlint.config.ts delete mode 120000 packages/vue-query-devtools/root.eslint.config.js create mode 120000 packages/vue-query-devtools/root.oxlint.config.ts delete mode 100644 packages/vue-query/eslint.config.js create mode 100644 packages/vue-query/oxlint.config.ts delete mode 120000 packages/vue-query/root.eslint.config.js create mode 120000 packages/vue-query/root.oxlint.config.ts create mode 100644 scripts/oxlint/plugin.ts diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index b18cf0f7776..00000000000 --- a/eslint.config.js +++ /dev/null @@ -1,165 +0,0 @@ -// @ts-check - -// @ts-ignore Needed due to moduleResolution Node vs Bundler -import { tanstackConfig } from '@tanstack/eslint-config' -import pluginCspell from '@cspell/eslint-plugin' -import vitest from '@vitest/eslint-plugin' -import pluginJsdoc from 'eslint-plugin-jsdoc' -import { defineConfig } from 'eslint/config' - -export default defineConfig([ - ...tanstackConfig, - { - name: 'tanstack/query/jsdoc', - files: ['**/src/**/*.{ts,tsx}'], - ignores: [ - '**/__tests__/**', - '**/__testfixtures__/**', - '**/*.test.{ts,tsx}', - '**/*.test-d.{ts,tsx}', - ], - extends: [pluginJsdoc.configs['flat/recommended-typescript-error']], - rules: { - 'jsdoc/check-tag-names': ['error', { definedTags: ['defaultValue'] }], - 'jsdoc/check-param-names': ['error', { checkDestructured: false }], - 'jsdoc/require-jsdoc': [ - 'error', - { - contexts: [ - 'ExportDefaultDeclaration > ArrowFunctionExpression', - 'ExportDefaultDeclaration > ClassDeclaration', - 'ExportDefaultDeclaration > ClassDeclaration > ClassBody > MethodDefinition:not([accessibility="private"]):not([key.type="PrivateIdentifier"]):not([kind="constructor"]):not([override=true])', - 'ExportNamedDeclaration > ClassDeclaration', - 'ExportNamedDeclaration > ClassDeclaration > ClassBody > MethodDefinition:not([accessibility="private"]):not([key.type="PrivateIdentifier"]):not([kind="constructor"]):not([override=true])', - 'ExportNamedDeclaration > TSInterfaceDeclaration', - 'ExportNamedDeclaration > TSInterfaceDeclaration > TSInterfaceBody > TSPropertySignature', - 'ExportNamedDeclaration > TSTypeAliasDeclaration', - 'ExportNamedDeclaration > TSTypeAliasDeclaration > TSTypeLiteral > TSPropertySignature', - 'ExportNamedDeclaration > VariableDeclaration > VariableDeclarator > ArrowFunctionExpression', - ], - }, - ], - 'jsdoc/require-param': ['error', { checkDestructured: false }], - 'jsdoc/check-template-names': 'error', - 'jsdoc/informative-docs': 'error', - 'jsdoc/match-description': 'error', - 'jsdoc/no-bad-blocks': 'error', - 'jsdoc/no-blank-block-descriptions': 'error', - 'jsdoc/no-blank-blocks': 'error', - 'jsdoc/require-asterisk-prefix': 'error', - 'jsdoc/require-description': 'error', - 'jsdoc/require-hyphen-before-param-description': 'error', - 'jsdoc/require-next-description': 'error', - 'jsdoc/require-template-description': 'error', - 'jsdoc/require-throws': 'error', - 'jsdoc/require-throws-description': 'error', - 'jsdoc/require-yields-description': 'error', - 'jsdoc/sort-tags': 'error', - }, - }, - { - name: 'tanstack/query', - plugins: { - cspell: pluginCspell, - }, - rules: { - 'cspell/spellchecker': [ - 'warn', - { - cspell: { - words: [ - 'Promisable', // Our public interface - 'TSES', // @typescript-eslint package's interface - 'codemod', // We support our codemod - 'combinate', // Library name - 'datatag', // Query options tagging - 'extralight', // Our public interface - 'jscodeshift', - 'refetched', // Query refetch operations - 'refetches', // Query refetch operations - 'retryer', // Our public interface - 'solidjs', // Our target framework - 'tabular-nums', // https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric - 'tanstack', // Our package scope - 'todos', // Too general word to be caught as error - 'tsqd', // Our public interface (TanStack Query Devtools shorthand) - 'tsdown', // We use tsdown as builder - 'typecheck', // Field of vite.config.ts - 'vue-demi', // dependency of @tanstack/vue-query - 'ɵkind', // Angular specific - 'ɵproviders', // Angular specific - ], - }, - }, - ], - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-unsafe-function-type': 'off', - 'no-case-declarations': 'off', - /** - * Disallows direct calls to deprecated imperative query methods of `QueryClient` - * for new tests and code - * - * Existing tests that directly test the methods from before the refactoring - * will be grandfathered in and allowed to continue using the deprecated methods. - * They should not be removed, but new tests should use the new methods instead. - */ - 'no-restricted-syntax': [ - 'error', - { - selector: - 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="fetchQuery"], [callee.computed=true][callee.property.value="fetchQuery"])', - message: 'Use queryClient.query(options) instead.', - }, - { - selector: - 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="prefetchQuery"], [callee.computed=true][callee.property.value="prefetchQuery"])', - message: - 'Use queryClient.query(options).catch(noop) instead if errors should be swallowed.', - }, - { - selector: - 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="ensureQueryData"], [callee.computed=true][callee.property.value="ensureQueryData"])', - message: - "Use queryClient.query({ ...options, staleTime: 'static' }) instead.", - }, - { - selector: - 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="fetchInfiniteQuery"], [callee.computed=true][callee.property.value="fetchInfiniteQuery"])', - message: 'Use queryClient.infiniteQuery(options) instead.', - }, - { - selector: - 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="prefetchInfiniteQuery"], [callee.computed=true][callee.property.value="prefetchInfiniteQuery"])', - message: - 'Use queryClient.infiniteQuery(options).catch(noop) instead if errors should be swallowed.', - }, - { - selector: - 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="ensureInfiniteQueryData"], [callee.computed=true][callee.property.value="ensureInfiniteQueryData"])', - message: - "Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead.", - }, - ], - 'prefer-const': 'off', - }, - }, - { - name: 'tanstack/query/vitest', - files: ['**/*.spec.ts*', '**/*.test.ts*', '**/*.test-d.ts*'], - plugins: { vitest }, - rules: { - ...vitest.configs.recommended.rules, - 'vitest/consistent-test-it': [ - 'error', - { fn: 'it', withinDescribe: 'it' }, - ], - 'vitest/no-standalone-expect': [ - 'error', - { - additionalTestBlockFunctions: ['itIf'], - }, - ], - }, - settings: { vitest: { typecheck: true } }, - }, -]) diff --git a/knip.ts b/knip.ts index f3e8040d8a6..a807a8d8b81 100644 --- a/knip.ts +++ b/knip.ts @@ -5,7 +5,11 @@ export default { ignore: ['scripts/*.{j,t}s', '**/ts-fixture/file.ts'], treatConfigHintsAsErrors: true, treatTagHintsAsErrors: true, - ignoreDependencies: ['@oxc-project/runtime'], + ignoreDependencies: [ + '@oxc-project/runtime', + // Used by the ESLint configs of the React examples + '@tanstack/eslint-config', + ], ignoreWorkspaces: ['examples/**', 'integrations/**'], rules: { duplicates: 'warn' }, workspaces: { diff --git a/nx.json b/nx.json index 7e6e5e201b2..e56b46ff67d 100644 --- a/nx.json +++ b/nx.json @@ -11,7 +11,7 @@ "{workspaceRoot}/package.json", "{workspaceRoot}/scripts/*.js", "{workspaceRoot}/tsconfig.json", - "{workspaceRoot}/eslint.config.js", + "{workspaceRoot}/oxlint.config.ts", "{workspaceRoot}/pnpm-workspace.yaml" ], "default": [ @@ -22,7 +22,8 @@ "production": [ "default", "!{projectRoot}/tests/**/*", - "!{projectRoot}/eslint.config.js" + "!{projectRoot}/eslint.config.js", + "!{projectRoot}/oxlint.config.ts" ] }, "targetDefaults": { @@ -60,7 +61,17 @@ "test:eslint": { "cache": true, "dependsOn": ["^compile"], - "inputs": ["default", "^production", "{workspaceRoot}/eslint.config.js"] + "inputs": ["default", "^production"] + }, + "test:oxlint": { + "cache": true, + "dependsOn": ["^compile"], + "inputs": [ + "default", + "^production", + "{workspaceRoot}/oxlint.config.ts", + "{workspaceRoot}/scripts/oxlint/*" + ] }, "test:lib": { "cache": true, diff --git a/oxlint.config.ts b/oxlint.config.ts new file mode 100644 index 00000000000..d4ee4b0cc05 --- /dev/null +++ b/oxlint.config.ts @@ -0,0 +1,388 @@ +import { fileURLToPath } from 'node:url' +import pluginJsdoc from 'eslint-plugin-jsdoc' +import { defineConfig } from 'oxlint' + +/** + * Oxlint ships a native `jsdoc` plugin that only covers part of + * 'eslint-plugin-jsdoc', so the original plugin is loaded as a JS plugin + * under the `jsdoc-js` alias and its recommended rules are renamed to match. + */ +const jsdocRecommendedRules = Object.fromEntries( + Object.entries( + pluginJsdoc.configs['flat/recommended-typescript-error'].rules ?? {}, + ).map(([name, value]) => [name.replace(/^jsdoc\//, 'jsdoc-js/'), value]), +) + +export default defineConfig({ + $schema: './node_modules/oxlint/configuration_schema.json', + plugins: ['import', 'typescript', 'unicorn', 'vitest'], + jsPlugins: [ + { name: 'import-js', specifier: 'eslint-plugin-import-x' }, + { name: 'jsdoc-js', specifier: 'eslint-plugin-jsdoc' }, + { name: 'cspell', specifier: '@cspell/eslint-plugin' }, + '@stylistic/eslint-plugin', + // Absolute path so that package configs can extend this config + fileURLToPath(new URL('./scripts/oxlint/plugin.ts', import.meta.url)), + ], + categories: { + correctness: 'off', + }, + options: { + typeAware: true, + }, + env: { + browser: true, + es2020: true, + }, + settings: { + vitest: { typecheck: true }, + }, + ignorePatterns: [ + '**/.nx/**', + '**/.svelte-kit/**', + '**/build/**', + '**/coverage/**', + '**/dist/**', + '**/snap/**', + '**/vite.config.*.timestamp-*.*', + ], + rules: { + // JavaScript + 'for-direction': 'error', + 'no-async-promise-executor': 'error', + 'no-class-assign': 'error', + 'no-compare-neg-zero': 'error', + 'no-cond-assign': 'error', + 'no-constant-binary-expression': 'error', + 'no-constant-condition': 'error', + 'no-control-regex': 'error', + 'no-debugger': 'error', + 'no-delete-var': 'error', + 'no-dupe-else-if': 'error', + 'no-duplicate-case': 'error', + 'no-empty-character-class': 'error', + 'no-empty-pattern': 'error', + 'no-empty-static-block': 'error', + 'no-ex-assign': 'error', + 'no-extra-boolean-cast': 'error', + 'no-fallthrough': 'error', + 'no-global-assign': 'error', + 'no-invalid-regexp': 'error', + 'no-irregular-whitespace': 'error', + 'no-loss-of-precision': 'error', + 'no-misleading-character-class': 'error', + 'no-nonoctal-decimal-escape': 'error', + 'no-regex-spaces': 'error', + 'no-self-assign': 'error', + 'no-shadow': 'warn', + 'no-shadow-restricted-names': 'error', + 'no-sparse-arrays': 'error', + 'no-unsafe-finally': 'error', + 'no-unsafe-optional-chaining': 'error', + 'no-unused-labels': 'error', + 'no-unused-private-class-members': 'error', + 'no-useless-backreference': 'error', + 'no-useless-catch': 'error', + 'no-useless-escape': 'error', + 'no-var': 'error', + 'no-with': 'error', + 'require-yield': 'error', + 'sort-imports': ['error', { ignoreDeclarationSort: true }], + 'use-isnan': 'error', + 'valid-typeof': 'error', + + // Imports + 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], + 'import/first': 'error', + 'import/newline-after-import': 'error', + 'import/no-commonjs': 'error', + 'import/no-duplicates': 'error', + 'import-js/order': [ + 'error', + { + groups: [ + 'builtin', + 'external', + 'internal', + 'parent', + 'sibling', + 'index', + 'object', + 'type', + ], + }, + ], + + // TypeScript + 'typescript/array-type': [ + 'error', + { default: 'generic', readonly: 'generic' }, + ], + 'typescript/ban-ts-comment': [ + 'error', + { 'ts-expect-error': false, 'ts-ignore': 'allow-with-description' }, + ], + 'typescript/consistent-type-imports': ['error', { prefer: 'type-imports' }], + 'typescript/method-signature-style': ['error', 'property'], + 'typescript/no-duplicate-enum-values': 'error', + 'typescript/no-extra-non-null-assertion': 'error', + 'typescript/no-for-in-array': 'error', + 'typescript/no-inferrable-types': ['error', { ignoreParameters: true }], + 'typescript/no-misused-new': 'error', + 'typescript/no-namespace': 'error', + 'typescript/no-non-null-asserted-optional-chain': 'error', + 'typescript/no-unnecessary-condition': 'error', + 'typescript/no-unnecessary-type-assertion': 'error', + 'typescript/no-wrapper-object-types': 'error', + 'typescript/prefer-as-const': 'error', + 'typescript/prefer-for-of': 'warn', + 'typescript/require-await': 'warn', + 'typescript/triple-slash-reference': 'error', + 'tanstack-query/type-parameter-naming': 'error', + + // Node + 'unicorn/prefer-node-protocol': 'error', + + // Stylistic + '@stylistic/spaced-comment': 'error', + + // Spelling + 'cspell/spellchecker': [ + 'warn', + { + cspell: { + words: [ + 'Promisable', // Our public interface + 'TSES', // @typescript-eslint package's interface + 'codemod', // We support our codemod + 'combinate', // Library name + 'datatag', // Query options tagging + 'extralight', // Our public interface + 'jscodeshift', + 'refetched', // Query refetch operations + 'refetches', // Query refetch operations + 'retryer', // Our public interface + 'solidjs', // Our target framework + 'tabular-nums', // https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric + 'tanstack', // Our package scope + 'todos', // Too general word to be caught as error + 'tsqd', // Our public interface (TanStack Query Devtools shorthand) + 'tsdown', // We use tsdown as builder + 'typecheck', // Field of vite.config.ts + 'vue-demi', // dependency of @tanstack/vue-query + 'ɵkind', // Angular specific + 'ɵproviders', // Angular specific + ], + }, + }, + ], + + /** + * Disallows direct calls to deprecated imperative query methods of `QueryClient` + * for new tests and code + * + * Existing tests that directly test the methods from before the refactoring + * will be grandfathered in and allowed to continue using the deprecated methods. + * They should not be removed, but new tests should use the new methods instead. + */ + 'tanstack-query/no-restricted-syntax': [ + 'error', + { + selector: + 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="fetchQuery"], [callee.computed=true][callee.property.value="fetchQuery"])', + message: 'Use queryClient.query(options) instead.', + }, + { + selector: + 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="prefetchQuery"], [callee.computed=true][callee.property.value="prefetchQuery"])', + message: + 'Use queryClient.query(options).catch(noop) instead if errors should be swallowed.', + }, + { + selector: + 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="ensureQueryData"], [callee.computed=true][callee.property.value="ensureQueryData"])', + message: + "Use queryClient.query({ ...options, staleTime: 'static' }) instead.", + }, + { + selector: + 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="fetchInfiniteQuery"], [callee.computed=true][callee.property.value="fetchInfiniteQuery"])', + message: 'Use queryClient.infiniteQuery(options) instead.', + }, + { + selector: + 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="prefetchInfiniteQuery"], [callee.computed=true][callee.property.value="prefetchInfiniteQuery"])', + message: + 'Use queryClient.infiniteQuery(options).catch(noop) instead if errors should be swallowed.', + }, + { + selector: + 'CallExpression[callee.type="MemberExpression"]:matches([callee.property.name="ensureInfiniteQueryData"], [callee.computed=true][callee.property.value="ensureInfiniteQueryData"])', + message: + "Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead.", + }, + ], + }, + overrides: [ + { + files: ['**/src/**/*.{ts,tsx}'], + excludeFiles: [ + '**/__tests__/**', + '**/__testfixtures__/**', + '**/*.test.{ts,tsx}', + '**/*.test-d.{ts,tsx}', + ], + rules: { + ...jsdocRecommendedRules, + 'jsdoc-js/check-tag-names': [ + 'error', + { definedTags: ['defaultValue'] }, + ], + 'jsdoc-js/check-param-names': ['error', { checkDestructured: false }], + 'jsdoc-js/require-jsdoc': [ + 'error', + { + contexts: [ + 'ExportDefaultDeclaration > ArrowFunctionExpression', + 'ExportDefaultDeclaration > ClassDeclaration', + 'ExportDefaultDeclaration > ClassDeclaration > ClassBody > MethodDefinition:not([accessibility="private"]):not([key.type="PrivateIdentifier"]):not([kind="constructor"]):not([override=true])', + 'ExportNamedDeclaration > ClassDeclaration', + 'ExportNamedDeclaration > ClassDeclaration > ClassBody > MethodDefinition:not([accessibility="private"]):not([key.type="PrivateIdentifier"]):not([kind="constructor"]):not([override=true])', + 'ExportNamedDeclaration > TSInterfaceDeclaration', + 'ExportNamedDeclaration > TSInterfaceDeclaration > TSInterfaceBody > TSPropertySignature', + 'ExportNamedDeclaration > TSTypeAliasDeclaration', + 'ExportNamedDeclaration > TSTypeAliasDeclaration > TSTypeLiteral > TSPropertySignature', + 'ExportNamedDeclaration > VariableDeclaration > VariableDeclarator > ArrowFunctionExpression', + ], + }, + ], + 'jsdoc-js/require-param': ['error', { checkDestructured: false }], + 'jsdoc-js/check-template-names': 'error', + 'jsdoc-js/informative-docs': 'error', + 'jsdoc-js/match-description': 'error', + 'jsdoc-js/no-bad-blocks': 'error', + 'jsdoc-js/no-blank-block-descriptions': 'error', + 'jsdoc-js/no-blank-blocks': 'error', + 'jsdoc-js/require-asterisk-prefix': 'error', + 'jsdoc-js/require-description': 'error', + 'jsdoc-js/require-hyphen-before-param-description': 'error', + 'jsdoc-js/require-next-description': 'error', + 'jsdoc-js/require-template-description': 'error', + 'jsdoc-js/require-throws': 'error', + 'jsdoc-js/require-throws-description': 'error', + 'jsdoc-js/require-yields-description': 'error', + 'jsdoc-js/sort-tags': 'error', + }, + }, + { + files: ['**/*.spec.ts*', '**/*.test.ts*', '**/*.test-d.ts*'], + rules: { + 'vitest/consistent-test-it': [ + 'error', + { fn: 'it', withinDescribe: 'it' }, + ], + 'vitest/expect-expect': 'error', + 'vitest/no-commented-out-tests': 'error', + 'vitest/no-conditional-expect': 'error', + 'vitest/no-disabled-tests': 'warn', + 'vitest/no-focused-tests': 'error', + 'vitest/no-identical-title': 'error', + 'vitest/no-import-node-test': 'error', + 'vitest/no-interpolation-in-snapshots': 'error', + 'vitest/no-mocks-import': 'error', + 'vitest/no-standalone-expect': [ + 'error', + { additionalTestBlockFunctions: ['itIf'] }, + ], + 'vitest/no-unneeded-async-expect-function': 'error', + 'vitest/prefer-called-exactly-once-with': 'error', + 'vitest/require-local-test-context-for-concurrent-snapshots': 'error', + 'vitest/valid-describe-callback': 'error', + 'vitest/valid-expect': 'error', + 'vitest/valid-expect-in-promise': 'error', + 'vitest/valid-title': 'error', + }, + }, + ], +}) + +/** + * Native Oxlint equivalent of 'eslint-config-preact', applied on top of the root config. + * + * Not ported because Oxlint does not implement them: `no-dupe-args`, `no-undef`, + * `no-undef-init`, `strict`, `react/jsx-no-bind`, `react/jsx-uses-react`, + * `react/jsx-uses-vars`, `react/no-deprecated`, `react/prefer-stateless-function` + * and `react/require-render-return`. + */ +export const preactConfig = defineConfig({ + plugins: ['import', 'typescript', 'unicorn', 'vitest', 'react'], + settings: { + react: { version: '16.0' }, + }, + rules: { + // 'eslint:recommended' + 'constructor-super': 'error', + 'getter-return': 'error', + 'no-case-declarations': 'error', + 'no-const-assign': 'error', + 'no-dupe-class-members': 'error', + 'no-dupe-keys': 'error', + 'no-func-assign': 'error', + 'no-new-native-nonconstructor': 'error', + 'no-obj-calls': 'error', + 'no-prototype-builtins': 'error', + 'no-setter-return': 'error', + 'no-this-before-super': 'error', + 'no-unexpected-multiline': 'error', + 'no-unreachable': 'error', + 'no-unsafe-negation': 'error', + + // Preact / JSX + 'react/display-name': ['warn', { ignoreTranspilerName: false }], + 'react/jsx-key': ['error', { checkFragmentShorthand: true }], + 'react/jsx-no-comment-textnodes': 'error', + 'react/jsx-no-duplicate-props': 'error', + 'react/jsx-no-target-blank': 'error', + 'react/jsx-no-undef': 'error', + 'react/no-danger': 'warn', + 'react/no-did-mount-set-state': 'error', + 'react/no-did-update-set-state': 'error', + 'react/no-find-dom-node': 'error', + 'react/no-is-mounted': 'error', + 'react/no-string-refs': 'error', + 'react/prefer-es6-class': 'error', + 'react/self-closing-comp': 'error', + + // Hooks + 'react/rules-of-hooks': 'error', + 'react/exhaustive-deps': 'warn', + + // General JavaScript error avoidance + 'no-caller': 'error', + 'no-else-return': 'warn', + 'no-empty-pattern': 'off', + 'no-iterator': 'error', + 'no-lonely-if': 'error', + 'no-multi-str': 'warn', + 'no-new-wrappers': 'error', + 'no-proto': 'error', + 'no-shadow': 'off', + 'no-unneeded-ternary': 'error', + 'no-useless-call': 'warn', + 'no-useless-computed-key': 'warn', + 'no-useless-concat': 'warn', + 'no-useless-constructor': 'warn', + 'no-useless-escape': 'warn', + 'no-useless-rename': 'warn', + 'no-var': 'warn', + + // General JavaScript style + 'object-shorthand': 'warn', + 'prefer-arrow-callback': 'warn', + 'prefer-rest-params': 'warn', + 'prefer-spread': 'warn', + 'prefer-template': 'warn', + radix: 'warn', + 'unicode-bom': 'error', + }, +}) diff --git a/package.json b/package.json index e60b19c6c20..831cc496e0b 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,10 @@ "scripts": { "clean": "pnpm --filter \"./packages/**\" run clean", "test": "pnpm run test:ci", - "test:pr": "nx affected --targets=test:sherif,test:knip,test:docs,test:eslint,test:lib,test:types,test:build,build", - "test:ci": "nx run-many --targets=test:sherif,test:knip,test:docs,test:eslint,test:lib,test:types,test:build,build", + "test:pr": "nx affected --targets=test:sherif,test:knip,test:docs,test:eslint,test:oxlint,test:lib,test:types,test:build,build", + "test:ci": "nx run-many --targets=test:sherif,test:knip,test:docs,test:eslint,test:oxlint,test:lib,test:types,test:build,build", "test:eslint": "nx affected --target=test:eslint", + "test:oxlint": "nx affected --target=test:oxlint", "test:sherif": "sherif -i typescript -p \"./integrations/*\" -p \"./examples/*\"", "test:size": "size-limit", "test:lib": "nx affected --target=test:lib --exclude=examples/**", @@ -53,19 +54,22 @@ "@changesets/cli": "^3.0.3", "@cspell/eslint-plugin": "^10.3.6", "@size-limit/preset-small-lib": "^14.0.0", + "@stylistic/eslint-plugin": "^5.10.0", "@tanstack/eslint-config": "0.4.0", "@tanstack/typedoc-config": "0.3.4", "@testing-library/jest-dom": "^6.8.0", "@types/node": "^22.15.3", "@vitest/coverage-istanbul": "4.1.11", - "@vitest/eslint-plugin": "^1.6.27", "eslint": "catalog:", + "eslint-plugin-import-x": "^4.17.1", "eslint-plugin-jsdoc": "^65.0.1", "jsdom": "^27.0.0", "knip": "6.38.0", "markdown-link-extractor": "^4.0.4", "npm-run-all2": "^9.0.3", "nx": "23.2.1", + "oxlint": "^1.87.0", + "oxlint-tsgolint": "^7.0.2003", "premove": "^4.0.0", "prettier": "^3.9.9", "prettier-plugin-svelte": "^4.1.1", diff --git a/packages/angular-query-experimental/eslint.config.js b/packages/angular-query-experimental/eslint.config.js deleted file mode 100644 index 032dfcd3ba9..00000000000 --- a/packages/angular-query-experimental/eslint.config.js +++ /dev/null @@ -1,25 +0,0 @@ -// @ts-check - -import vitest from '@vitest/eslint-plugin' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - { - plugins: { vitest }, - rules: { - 'vitest/expect-expect': [ - 'error', - { assertFunctionNames: ['expect', 'expectSignals'] }, - ], - }, - }, - { - files: ['**/__tests__/**'], - rules: { - '@typescript-eslint/no-unnecessary-condition': 'off', - '@typescript-eslint/require-await': 'off', - }, - }, -]) diff --git a/packages/angular-query-experimental/oxlint.config.ts b/packages/angular-query-experimental/oxlint.config.ts new file mode 100644 index 00000000000..f7ef5cc1a63 --- /dev/null +++ b/packages/angular-query-experimental/oxlint.config.ts @@ -0,0 +1,31 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + overrides: [ + { + files: ['**/*.spec.ts*', '**/*.test.ts*', '**/*.test-d.ts*'], + rules: { + 'vitest/expect-expect': [ + 'error', + { + assertFunctionNames: [ + 'expect', + 'expectSignals', + 'expectTypeOf', + 'assertType', + ], + }, + ], + }, + }, + { + files: ['**/__tests__/**'], + rules: { + 'typescript/no-unnecessary-condition': 'off', + 'typescript/require-await': 'off', + }, + }, + ], +}) diff --git a/packages/angular-query-experimental/package.json b/packages/angular-query-experimental/package.json index 868ab057dbb..d86255ef1e4 100644 --- a/packages/angular-query-experimental/package.json +++ b/packages/angular-query-experimental/package.json @@ -29,7 +29,7 @@ "scripts": { "clean": "premove ./dist ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/angular-query-experimental/root.eslint.config.js b/packages/angular-query-experimental/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/angular-query-experimental/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/angular-query-experimental/root.oxlint.config.ts b/packages/angular-query-experimental/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/angular-query-experimental/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts b/packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts index 91a9d7e2fdf..a1d22d865cd 100644 --- a/packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts +++ b/packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts @@ -72,7 +72,7 @@ describe('infiniteQueryOptions', () => { initialPageParam: 1, }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() @@ -225,17 +225,17 @@ describe('infiniteQueryOptions', () => { // deprecated methods below to be removed next major version assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchQuery(options), ) }) diff --git a/packages/angular-query-experimental/src/__tests__/query-options.test-d.ts b/packages/angular-query-experimental/src/__tests__/query-options.test-d.ts index 18f6499999e..4f91505ea37 100644 --- a/packages/angular-query-experimental/src/__tests__/query-options.test-d.ts +++ b/packages/angular-query-experimental/src/__tests__/query-options.test-d.ts @@ -89,7 +89,7 @@ it('should work when passed to fetchQuery', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = new QueryClient().fetchQuery(options) assertType>(data) }) diff --git a/packages/angular-query-persist-client/eslint.config.js b/packages/angular-query-persist-client/eslint.config.js deleted file mode 100644 index b64cd9f27e4..00000000000 --- a/packages/angular-query-persist-client/eslint.config.js +++ /dev/null @@ -1,20 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - { - rules: { - 'cspell/spellchecker': [ - 'warn', - { - cspell: { - ignoreRegExpList: ['\\ɵ.+'], - }, - }, - ], - }, - }, -]) diff --git a/packages/angular-query-persist-client/oxlint.config.ts b/packages/angular-query-persist-client/oxlint.config.ts new file mode 100644 index 00000000000..ce32049dc0e --- /dev/null +++ b/packages/angular-query-persist-client/oxlint.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + rules: { + 'cspell/spellchecker': [ + 'warn', + { + cspell: { + ignoreRegExpList: ['\\ɵ.+'], + }, + }, + ], + }, +}) diff --git a/packages/angular-query-persist-client/package.json b/packages/angular-query-persist-client/package.json index 5558bd56781..293b06eda6f 100644 --- a/packages/angular-query-persist-client/package.json +++ b/packages/angular-query-persist-client/package.json @@ -18,7 +18,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/angular-query-persist-client/root.eslint.config.js b/packages/angular-query-persist-client/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/angular-query-persist-client/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/angular-query-persist-client/root.oxlint.config.ts b/packages/angular-query-persist-client/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/angular-query-persist-client/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/eslint-plugin-query/eslint.config.js b/packages/eslint-plugin-query/eslint.config.js deleted file mode 100644 index 2cedfbc5905..00000000000 --- a/packages/eslint-plugin-query/eslint.config.js +++ /dev/null @@ -1,21 +0,0 @@ -// @ts-check - -import vitest from '@vitest/eslint-plugin' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - { - plugins: { vitest }, - rules: { - ...vitest.configs.recommended.rules, - 'vitest/expect-expect': [ - 'warn', - { - assertFunctionNames: ['expect', 'expectArrayEqualIgnoreOrder'], - }, - ], - }, - }, -]) diff --git a/packages/eslint-plugin-query/oxlint.config.ts b/packages/eslint-plugin-query/oxlint.config.ts new file mode 100644 index 00000000000..5ee23a35328 --- /dev/null +++ b/packages/eslint-plugin-query/oxlint.config.ts @@ -0,0 +1,17 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + overrides: [ + { + files: ['**/*.spec.ts*', '**/*.test.ts*', '**/*.test-d.ts*'], + rules: { + 'vitest/expect-expect': [ + 'warn', + { assertFunctionNames: ['expect', 'expectArrayEqualIgnoreOrder'] }, + ], + }, + }, + ], +}) diff --git a/packages/eslint-plugin-query/package.json b/packages/eslint-plugin-query/package.json index be3730e94a5..7fd8706d339 100644 --- a/packages/eslint-plugin-query/package.json +++ b/packages/eslint-plugin-query/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./dist ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/eslint-plugin-query/root.eslint.config.js b/packages/eslint-plugin-query/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/eslint-plugin-query/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/eslint-plugin-query/root.oxlint.config.ts b/packages/eslint-plugin-query/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/eslint-plugin-query/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/lit-query/eslint.config.js b/packages/lit-query/eslint.config.js deleted file mode 100644 index e3074fb05a7..00000000000 --- a/packages/lit-query/eslint.config.js +++ /dev/null @@ -1,14 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - { - files: ['**/__tests__/**'], - rules: { - '@typescript-eslint/no-unnecessary-condition': 'off', - }, - }, -]) diff --git a/packages/lit-query/oxlint.config.ts b/packages/lit-query/oxlint.config.ts new file mode 100644 index 00000000000..8f5e331e8fa --- /dev/null +++ b/packages/lit-query/oxlint.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + overrides: [ + { + files: ['**/__tests__/**'], + rules: { + 'typescript/no-unnecessary-condition': 'off', + }, + }, + ], +}) diff --git a/packages/lit-query/package.json b/packages/lit-query/package.json index a72bc76045d..6dcc08a1da7 100644 --- a/packages/lit-query/package.json +++ b/packages/lit-query/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/lit-query/root.eslint.config.js b/packages/lit-query/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/lit-query/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/lit-query/root.oxlint.config.ts b/packages/lit-query/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/lit-query/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/preact-query-devtools/eslint.config.js b/packages/preact-query-devtools/eslint.config.js deleted file mode 100644 index 5882d19509f..00000000000 --- a/packages/preact-query-devtools/eslint.config.js +++ /dev/null @@ -1,24 +0,0 @@ -// @ts-check - -// @ts-ignore: no types for eslint-config-preact -import preact from 'eslint-config-preact' -import tsParser from '@typescript-eslint/parser' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - ...preact, - { - languageOptions: { - parser: tsParser, - }, - rules: { - // Base rules from 'eslint-config-preact' that are already covered by TypeScript and 'import/no-duplicates' - 'no-redeclare': 'off', - 'no-duplicate-imports': 'off', - 'no-unused-vars': 'off', - 'no-import-assign': 'off', - }, - }, -]) diff --git a/packages/preact-query-devtools/oxlint.config.ts b/packages/preact-query-devtools/oxlint.config.ts new file mode 100644 index 00000000000..fd50faebb5e --- /dev/null +++ b/packages/preact-query-devtools/oxlint.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from 'oxlint' +import rootConfig, { preactConfig } from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig, preactConfig], +}) diff --git a/packages/preact-query-devtools/package.json b/packages/preact-query-devtools/package.json index 4c6d7c8d76c..dbb83f184e5 100644 --- a/packages/preact-query-devtools/package.json +++ b/packages/preact-query-devtools/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", @@ -82,8 +82,6 @@ "@preact/preset-vite": "catalog:", "@tanstack/preact-query": "workspace:*", "@testing-library/preact": "catalog:", - "@typescript-eslint/parser": "catalog:", - "eslint-config-preact": "catalog:", "preact": "catalog:", "typescript": "catalog:" }, diff --git a/packages/preact-query-devtools/root.eslint.config.js b/packages/preact-query-devtools/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/preact-query-devtools/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/preact-query-devtools/root.oxlint.config.ts b/packages/preact-query-devtools/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/preact-query-devtools/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/preact-query-persist-client/eslint.config.js b/packages/preact-query-persist-client/eslint.config.js deleted file mode 100644 index 5882d19509f..00000000000 --- a/packages/preact-query-persist-client/eslint.config.js +++ /dev/null @@ -1,24 +0,0 @@ -// @ts-check - -// @ts-ignore: no types for eslint-config-preact -import preact from 'eslint-config-preact' -import tsParser from '@typescript-eslint/parser' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - ...preact, - { - languageOptions: { - parser: tsParser, - }, - rules: { - // Base rules from 'eslint-config-preact' that are already covered by TypeScript and 'import/no-duplicates' - 'no-redeclare': 'off', - 'no-duplicate-imports': 'off', - 'no-unused-vars': 'off', - 'no-import-assign': 'off', - }, - }, -]) diff --git a/packages/preact-query-persist-client/oxlint.config.ts b/packages/preact-query-persist-client/oxlint.config.ts new file mode 100644 index 00000000000..fd50faebb5e --- /dev/null +++ b/packages/preact-query-persist-client/oxlint.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from 'oxlint' +import rootConfig, { preactConfig } from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig, preactConfig], +}) diff --git a/packages/preact-query-persist-client/package.json b/packages/preact-query-persist-client/package.json index 9ede0f00867..856d3f32021 100644 --- a/packages/preact-query-persist-client/package.json +++ b/packages/preact-query-persist-client/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", @@ -62,8 +62,6 @@ "@tanstack/preact-query": "workspace:*", "@tanstack/query-test-utils": "workspace:*", "@testing-library/preact": "catalog:", - "@typescript-eslint/parser": "catalog:", - "eslint-config-preact": "catalog:", "preact": "catalog:", "typescript": "catalog:" }, diff --git a/packages/preact-query-persist-client/root.eslint.config.js b/packages/preact-query-persist-client/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/preact-query-persist-client/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/preact-query-persist-client/root.oxlint.config.ts b/packages/preact-query-persist-client/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/preact-query-persist-client/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/preact-query/eslint.config.js b/packages/preact-query/eslint.config.js deleted file mode 100644 index 371dc5cabc9..00000000000 --- a/packages/preact-query/eslint.config.js +++ /dev/null @@ -1,30 +0,0 @@ -// @ts-check - -// @ts-ignore: no types for eslint-config-preact -import preact from 'eslint-config-preact' -import tsParser from '@typescript-eslint/parser' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - ...preact, - { - languageOptions: { - parser: tsParser, - }, - rules: { - // Base rules from 'eslint-config-preact' that are already covered by TypeScript and 'import/no-duplicates' - 'no-redeclare': 'off', - 'no-duplicate-imports': 'off', - 'no-unused-vars': 'off', - 'no-import-assign': 'off', - }, - }, - { - files: ['**/__tests__/**'], - rules: { - '@typescript-eslint/no-unnecessary-condition': 'off', - }, - }, -]) diff --git a/packages/preact-query/oxlint.config.ts b/packages/preact-query/oxlint.config.ts new file mode 100644 index 00000000000..8fd14c64d40 --- /dev/null +++ b/packages/preact-query/oxlint.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'oxlint' +import rootConfig, { preactConfig } from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig, preactConfig], + overrides: [ + { + files: ['**/__tests__/**'], + rules: { + 'typescript/no-unnecessary-condition': 'off', + }, + }, + ], +}) diff --git a/packages/preact-query/package.json b/packages/preact-query/package.json index b1e6daced91..4415e917e58 100644 --- a/packages/preact-query/package.json +++ b/packages/preact-query/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", @@ -68,8 +68,6 @@ "@tanstack/query-persist-client-core": "workspace:*", "@tanstack/query-test-utils": "workspace:*", "@testing-library/preact": "catalog:", - "@typescript-eslint/parser": "catalog:", - "eslint-config-preact": "catalog:", "preact": "catalog:", "preact-render-to-string": "^6.6.4", "typescript": "catalog:" diff --git a/packages/preact-query/root.eslint.config.js b/packages/preact-query/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/preact-query/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/preact-query/root.oxlint.config.ts b/packages/preact-query/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/preact-query/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsx b/packages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsx index 773c259f59b..6c3147241e5 100644 --- a/packages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsx +++ b/packages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsx @@ -131,7 +131,7 @@ describe('infiniteQueryOptions', () => { initialPageParam: 1, }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() @@ -235,17 +235,17 @@ describe('infiniteQueryOptions', () => { // deprecated methods below to be removed next major version assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchQuery(options), ) }) diff --git a/packages/preact-query/src/__tests__/queryOptions.test-d.tsx b/packages/preact-query/src/__tests__/queryOptions.test-d.tsx index 36929a8ea53..8d7f5e62676 100644 --- a/packages/preact-query/src/__tests__/queryOptions.test-d.tsx +++ b/packages/preact-query/src/__tests__/queryOptions.test-d.tsx @@ -100,7 +100,7 @@ describe('queryOptions', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) diff --git a/packages/preact-query/src/__tests__/useInfiniteQuery.test-d.tsx b/packages/preact-query/src/__tests__/useInfiniteQuery.test-d.tsx index 4fc87f63baf..a20b8427751 100644 --- a/packages/preact-query/src/__tests__/useInfiniteQuery.test-d.tsx +++ b/packages/preact-query/src/__tests__/useInfiniteQuery.test-d.tsx @@ -31,7 +31,7 @@ describe('pageParam', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for fetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { @@ -55,7 +55,7 @@ describe('pageParam', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for prefetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { diff --git a/packages/query-async-storage-persister/eslint.config.js b/packages/query-async-storage-persister/eslint.config.js deleted file mode 100644 index 6c83db5a905..00000000000 --- a/packages/query-async-storage-persister/eslint.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig]) diff --git a/packages/query-async-storage-persister/oxlint.config.ts b/packages/query-async-storage-persister/oxlint.config.ts new file mode 100644 index 00000000000..0352b334818 --- /dev/null +++ b/packages/query-async-storage-persister/oxlint.config.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ extends: [rootConfig] }) diff --git a/packages/query-async-storage-persister/package.json b/packages/query-async-storage-persister/package.json index 55769f67058..fd40a84b1b6 100644 --- a/packages/query-async-storage-persister/package.json +++ b/packages/query-async-storage-persister/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/query-async-storage-persister/root.eslint.config.js b/packages/query-async-storage-persister/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/query-async-storage-persister/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/query-async-storage-persister/root.oxlint.config.ts b/packages/query-async-storage-persister/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/query-async-storage-persister/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/query-broadcast-client-experimental/eslint.config.js b/packages/query-broadcast-client-experimental/eslint.config.js deleted file mode 100644 index 6c83db5a905..00000000000 --- a/packages/query-broadcast-client-experimental/eslint.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig]) diff --git a/packages/query-broadcast-client-experimental/oxlint.config.ts b/packages/query-broadcast-client-experimental/oxlint.config.ts new file mode 100644 index 00000000000..0352b334818 --- /dev/null +++ b/packages/query-broadcast-client-experimental/oxlint.config.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ extends: [rootConfig] }) diff --git a/packages/query-broadcast-client-experimental/package.json b/packages/query-broadcast-client-experimental/package.json index 6c5dfcfbf39..c6fcd6a191a 100644 --- a/packages/query-broadcast-client-experimental/package.json +++ b/packages/query-broadcast-client-experimental/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/query-broadcast-client-experimental/root.eslint.config.js b/packages/query-broadcast-client-experimental/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/query-broadcast-client-experimental/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/query-broadcast-client-experimental/root.oxlint.config.ts b/packages/query-broadcast-client-experimental/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/query-broadcast-client-experimental/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/query-codemods/eslint.config.js b/packages/query-codemods/eslint.config.js deleted file mode 100644 index eda71c4b407..00000000000 --- a/packages/query-codemods/eslint.config.js +++ /dev/null @@ -1,26 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - { - rules: { - 'cspell/spellchecker': 'off', - '@typescript-eslint/no-unnecessary-condition': 'off', - 'import/no-duplicates': 'off', - 'import/no-unresolved': 'off', - 'import/order': 'off', - 'no-shadow': 'off', - 'sort-imports': 'off', - }, - }, - { - files: ['src/**/__testfixtures__/**'], - rules: { - // Codemod fixtures intentionally preserve historical QueryClient syntax. - 'no-restricted-syntax': 'off', - }, - }, -]) diff --git a/packages/query-codemods/oxlint.config.ts b/packages/query-codemods/oxlint.config.ts new file mode 100644 index 00000000000..d71a6169eff --- /dev/null +++ b/packages/query-codemods/oxlint.config.ts @@ -0,0 +1,30 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + rules: { + 'cspell/spellchecker': 'off', + 'typescript/no-unnecessary-condition': 'off', + 'import/no-duplicates': 'off', + 'import-js/order': 'off', + 'no-shadow': 'off', + 'sort-imports': 'off', + }, + overrides: [ + { + // The codemods are CommonJS modules run by jscodeshift + files: ['**/*.cjs'], + rules: { + 'import/no-commonjs': 'off', + }, + }, + { + files: ['src/**/__testfixtures__/**'], + rules: { + // Codemod fixtures intentionally preserve historical QueryClient syntax. + 'tanstack-query/no-restricted-syntax': 'off', + }, + }, + ], +}) diff --git a/packages/query-codemods/package.json b/packages/query-codemods/package.json index 19d3204fff2..038d9a9365d 100644 --- a/packages/query-codemods/package.json +++ b/packages/query-codemods/package.json @@ -16,7 +16,7 @@ }, "scripts": { "clean": "premove ./coverage ./dist-ts", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm run test:lib --watch" }, diff --git a/packages/query-codemods/root.eslint.config.js b/packages/query-codemods/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/query-codemods/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/query-codemods/root.oxlint.config.ts b/packages/query-codemods/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/query-codemods/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/query-core/eslint.config.js b/packages/query-core/eslint.config.js deleted file mode 100644 index 6c83db5a905..00000000000 --- a/packages/query-core/eslint.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig]) diff --git a/packages/query-core/oxlint.config.ts b/packages/query-core/oxlint.config.ts new file mode 100644 index 00000000000..0352b334818 --- /dev/null +++ b/packages/query-core/oxlint.config.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ extends: [rootConfig] }) diff --git a/packages/query-core/package.json b/packages/query-core/package.json index 7e1909a9190..a818cc35cc3 100644 --- a/packages/query-core/package.json +++ b/packages/query-core/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/query-core/root.eslint.config.js b/packages/query-core/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/query-core/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/query-core/root.oxlint.config.ts b/packages/query-core/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/query-core/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/query-core/src/__tests__/queryClient.test-d.tsx b/packages/query-core/src/__tests__/queryClient.test-d.tsx index a02fbc009b1..12e5313d5f5 100644 --- a/packages/query-core/src/__tests__/queryClient.test-d.tsx +++ b/packages/query-core/src/__tests__/queryClient.test-d.tsx @@ -386,7 +386,7 @@ describe('queryClient', () => { it('should resolve with the data type', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.fetchQuery(typedQueryOptions) expectTypeOf(data).toEqualTypeOf() @@ -394,7 +394,7 @@ describe('queryClient', () => { it('should resolve with unknown when untyped', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.fetchQuery(untypedQueryOptions) expectTypeOf(data).toEqualTypeOf() @@ -419,7 +419,7 @@ describe('queryClient', () => { }) it('should allow passing pages', async () => { - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery({ queryKey: queryKey(), queryFn: () => Promise.resolve('string'), @@ -456,7 +456,7 @@ describe('queryClient', () => { it('should resolve with InfiniteData of the data type', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.fetchInfiniteQuery( typedFetchInfiniteQueryOptions, ) @@ -466,7 +466,7 @@ describe('queryClient', () => { it('should resolve with InfiniteData of unknown when untyped', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.fetchInfiniteQuery( untypedFetchInfiniteQueryOptions, ) @@ -525,7 +525,7 @@ describe('queryClient', () => { describe('ensureQueryData', () => { it('should resolve with the data type', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.ensureQueryData(typedQueryOptions) expectTypeOf(data).toEqualTypeOf() @@ -533,7 +533,7 @@ describe('queryClient', () => { it('should resolve with unknown when untyped', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.ensureQueryData(untypedQueryOptions) expectTypeOf(data).toEqualTypeOf() @@ -649,7 +649,7 @@ describe('queryClient', () => { describe('ensureInfiniteQueryData', () => { it('should resolve with InfiniteData of the data type', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.ensureInfiniteQueryData( typedFetchInfiniteQueryOptions, ) @@ -659,7 +659,7 @@ describe('queryClient', () => { it('should resolve with InfiniteData of unknown when untyped', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.ensureInfiniteQueryData( untypedFetchInfiniteQueryOptions, ) @@ -670,7 +670,7 @@ describe('queryClient', () => { it('should accept a revalidateIfStale that FetchInfiniteQueryOptions does not have', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ ...typedFetchInfiniteQueryOptions, revalidateIfStale: true, @@ -942,7 +942,7 @@ describe('queryClient', () => { describe('prefetchQuery', () => { it('should return a promise of void rather than the data', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const result = queryClient.prefetchQuery({ queryKey: ['key'], queryFn: () => Promise.resolve('string'), @@ -955,7 +955,7 @@ describe('queryClient', () => { describe('prefetchInfiniteQuery', () => { it('should return a promise of void rather than the pages', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const result = queryClient.prefetchInfiniteQuery({ queryKey: ['key'], queryFn: () => Promise.resolve('string'), @@ -1163,6 +1163,7 @@ describe('queryClient', () => { ).toEqualTypeOf() }) + // eslint-disable-next-line vitest/expect-expect -- Oxlint does not find assertions inside object methods it('should type the onSettled callback arguments', () => { const queryClient = new QueryClient() diff --git a/packages/query-core/src/__tests__/queryClient.test.tsx b/packages/query-core/src/__tests__/queryClient.test.tsx index d64968cc2ed..135ee29a35c 100644 --- a/packages/query-core/src/__tests__/queryClient.test.tsx +++ b/packages/query-core/src/__tests__/queryClient.test.tsx @@ -478,7 +478,7 @@ describe('queryClient', () => { queryClient.setQueryData([key, 'id'], 'bar') await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn }), ).resolves.toEqual('bar') }) @@ -489,7 +489,7 @@ describe('queryClient', () => { queryClient.setQueryData([key, 'id'], null) await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn }), ).resolves.toEqual(null) }) @@ -499,7 +499,7 @@ describe('queryClient', () => { const queryFn = () => Promise.resolve('data') await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key], queryFn }), ).resolves.toEqual('data') }) @@ -515,7 +515,7 @@ describe('queryClient', () => { }) await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn, @@ -524,7 +524,7 @@ describe('queryClient', () => { ).resolves.toEqual('old') await vi.advanceTimersByTimeAsync(TIMEOUT + 10) await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn, @@ -538,7 +538,7 @@ describe('queryClient', () => { const queryFn = vi.fn().mockImplementation(() => Promise.resolve('data')) await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn, @@ -647,7 +647,7 @@ describe('queryClient', () => { queryClient.setQueryData([key, 'id'], { pages: ['bar'], pageParams: [0] }) await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ queryKey: [key, 'id'], queryFn, @@ -662,7 +662,7 @@ describe('queryClient', () => { const queryFn = () => Promise.resolve('data') await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ queryKey: [key, 'id'], queryFn, @@ -680,7 +680,7 @@ describe('queryClient', () => { const queryFn = () => sleep(TIMEOUT).then(() => 'new') await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ queryKey: [key, 'id'], queryFn, @@ -691,7 +691,7 @@ describe('queryClient', () => { ).resolves.toEqual({ pages: ['old'], pageParams: [0] }) await vi.advanceTimersByTimeAsync(TIMEOUT + 10) await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ queryKey: [key, 'id'], queryFn, @@ -783,7 +783,7 @@ describe('queryClient', () => { Promise.resolve('data') await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -796,7 +796,7 @@ describe('queryClient', () => { const key = queryKey() await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery({ queryKey: key, queryFn: (): Promise => { @@ -810,13 +810,13 @@ describe('queryClient', () => { const key = queryKey() const fetchFn = () => Promise.resolve('data') - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const first = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const second = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -829,7 +829,7 @@ describe('queryClient', () => { const fetchFn = vi.fn(() => Promise.resolve({ data: 'data' })) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const first = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -843,7 +843,7 @@ describe('queryClient', () => { refetchType: 'none', }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const second = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -856,7 +856,7 @@ describe('queryClient', () => { it('should be able to fetch when garbage collection time is set to 0 and then be removed', async () => { const key1 = queryKey() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const promise = queryClient.fetchQuery({ queryKey: key1, queryFn: () => sleep(10).then(() => 1), @@ -870,7 +870,7 @@ describe('queryClient', () => { it('should keep a query in cache if garbage collection time is Infinity', async () => { const key1 = queryKey() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const promise = queryClient.fetchQuery({ queryKey: key1, queryFn: () => sleep(10).then(() => 1), @@ -886,7 +886,7 @@ describe('queryClient', () => { const key = queryKey() queryClient.setQueryData(key, 'og') const fetchFn = () => Promise.resolve('new') - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const first = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -903,7 +903,7 @@ describe('queryClient', () => { const queryFn = () => ++count queryClient.setQueryData(key, count) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const firstPromise = queryClient.fetchQuery({ queryKey: key, queryFn, @@ -911,14 +911,14 @@ describe('queryClient', () => { }) await expect(firstPromise).resolves.toBe(0) await vi.advanceTimersByTimeAsync(10) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const secondPromise = queryClient.fetchQuery({ queryKey: key, queryFn, staleTime: 10, }) await expect(secondPromise).resolves.toBe(1) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const thirdPromise = queryClient.fetchQuery({ queryKey: key, queryFn, @@ -926,7 +926,7 @@ describe('queryClient', () => { }) await expect(thirdPromise).resolves.toBe(1) await vi.advanceTimersByTimeAsync(10) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const fourthPromise = queryClient.fetchQuery({ queryKey: key, queryFn, @@ -938,7 +938,7 @@ describe('queryClient', () => { it('should allow new meta', async () => { const key = queryKey() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const first = await queryClient.fetchQuery({ queryKey: key, queryFn: ({ meta }) => Promise.resolve(meta), @@ -948,7 +948,7 @@ describe('queryClient', () => { }) expect(first).toStrictEqual({ foo: true }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const second = await queryClient.fetchQuery({ queryKey: key, queryFn: ({ meta }) => Promise.resolve(meta), @@ -1389,7 +1389,7 @@ describe('queryClient', () => { Promise.resolve(data.pages[0]) await expect( - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery< StrictData, any, @@ -1402,7 +1402,7 @@ describe('queryClient', () => { it('should return infinite query data', async () => { const key = queryKey() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const result = await queryClient.fetchInfiniteQuery({ queryKey: key, initialPageParam: 10, @@ -1650,7 +1650,7 @@ describe('queryClient', () => { const fetchFn: QueryFunction = () => Promise.resolve('data') - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchInfiniteQuery< StrictData, any, @@ -1670,7 +1670,7 @@ describe('queryClient', () => { it('should return infinite query data', async () => { const key = queryKey() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchInfiniteQuery({ queryKey: key, queryFn: ({ pageParam }) => Number(pageParam), @@ -1688,7 +1688,7 @@ describe('queryClient', () => { it('should prefetch multiple pages', async () => { const key = queryKey() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchInfiniteQuery({ queryKey: key, queryFn: ({ pageParam }) => String(pageParam), @@ -1710,7 +1710,7 @@ describe('queryClient', () => { const key = queryKey() let count = 0 - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchInfiniteQuery({ queryKey: key, queryFn: ({ pageParam }) => String(pageParam), @@ -1839,7 +1839,7 @@ describe('queryClient', () => { const fetchFn: QueryFunction = () => Promise.resolve('data') - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchQuery< StrictData, any, @@ -1855,7 +1855,7 @@ describe('queryClient', () => { it('should return undefined when an error is thrown', async () => { const key = queryKey() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const result = await queryClient.prefetchQuery({ queryKey: key, queryFn: (): Promise => { @@ -1869,7 +1869,7 @@ describe('queryClient', () => { it('should be garbage collected after gcTime if unused', async () => { const key = queryKey() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchQuery({ queryKey: key, queryFn: () => 'data', diff --git a/packages/query-core/src/queryClient.ts b/packages/query-core/src/queryClient.ts index 52a7c30fa55..6d75176e11d 100644 --- a/packages/query-core/src/queryClient.ts +++ b/packages/query-core/src/queryClient.ts @@ -217,7 +217,7 @@ export class QueryClient { const cachedData = query.state.data if (cachedData === undefined) { - // eslint-disable-next-line no-restricted-syntax + // eslint-disable-next-line tanstack-query/no-restricted-syntax return this.fetchQuery(options) } @@ -225,7 +225,7 @@ export class QueryClient { options.revalidateIfStale && query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ) { - // eslint-disable-next-line no-restricted-syntax + // eslint-disable-next-line tanstack-query/no-restricted-syntax void this.prefetchQuery(defaultedOptions) } @@ -691,7 +691,7 @@ export class QueryClient { >( options: FetchQueryOptions, ): Promise { - // eslint-disable-next-line no-restricted-syntax + // eslint-disable-next-line tanstack-query/no-restricted-syntax return this.fetchQuery(options).then(noop).catch(noop) } @@ -766,7 +766,7 @@ export class QueryClient { >, ): Promise> { options._type = 'infinite' - // eslint-disable-next-line no-restricted-syntax + // eslint-disable-next-line tanstack-query/no-restricted-syntax return this.fetchQuery(options as any) } @@ -793,7 +793,7 @@ export class QueryClient { TPageParam >, ): Promise { - // eslint-disable-next-line no-restricted-syntax + // eslint-disable-next-line tanstack-query/no-restricted-syntax return this.fetchInfiniteQuery(options).then(noop).catch(noop) } @@ -823,7 +823,7 @@ export class QueryClient { ): Promise> { options._type = 'infinite' - // eslint-disable-next-line no-restricted-syntax + // eslint-disable-next-line tanstack-query/no-restricted-syntax return this.ensureQueryData(options as any) } diff --git a/packages/query-core/src/streamedQuery.ts b/packages/query-core/src/streamedQuery.ts index c07008a0ca4..695d6d08116 100644 --- a/packages/query-core/src/streamedQuery.ts +++ b/packages/query-core/src/streamedQuery.ts @@ -96,7 +96,7 @@ export function streamedQuery< let result = initialValue // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion - let cancelled: boolean = false as boolean + let cancelled = false as boolean const streamFnContext = addConsumeAwareSignal< OmitKeyof >( diff --git a/packages/query-devtools/eslint.config.js b/packages/query-devtools/eslint.config.js deleted file mode 100644 index 6c83db5a905..00000000000 --- a/packages/query-devtools/eslint.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig]) diff --git a/packages/query-devtools/oxlint.config.ts b/packages/query-devtools/oxlint.config.ts new file mode 100644 index 00000000000..0352b334818 --- /dev/null +++ b/packages/query-devtools/oxlint.config.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ extends: [rootConfig] }) diff --git a/packages/query-devtools/package.json b/packages/query-devtools/package.json index 9eaf4424219..9a52e96de90 100644 --- a/packages/query-devtools/package.json +++ b/packages/query-devtools/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/query-devtools/root.eslint.config.js b/packages/query-devtools/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/query-devtools/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/query-devtools/root.oxlint.config.ts b/packages/query-devtools/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/query-devtools/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/query-persist-client-core/eslint.config.js b/packages/query-persist-client-core/eslint.config.js deleted file mode 100644 index 6c83db5a905..00000000000 --- a/packages/query-persist-client-core/eslint.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig]) diff --git a/packages/query-persist-client-core/oxlint.config.ts b/packages/query-persist-client-core/oxlint.config.ts new file mode 100644 index 00000000000..0352b334818 --- /dev/null +++ b/packages/query-persist-client-core/oxlint.config.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ extends: [rootConfig] }) diff --git a/packages/query-persist-client-core/package.json b/packages/query-persist-client-core/package.json index 952b3ccbed4..10fb05fbacb 100644 --- a/packages/query-persist-client-core/package.json +++ b/packages/query-persist-client-core/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/query-persist-client-core/root.eslint.config.js b/packages/query-persist-client-core/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/query-persist-client-core/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/query-persist-client-core/root.oxlint.config.ts b/packages/query-persist-client-core/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/query-persist-client-core/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/query-sync-storage-persister/eslint.config.js b/packages/query-sync-storage-persister/eslint.config.js deleted file mode 100644 index 6c83db5a905..00000000000 --- a/packages/query-sync-storage-persister/eslint.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig]) diff --git a/packages/query-sync-storage-persister/oxlint.config.ts b/packages/query-sync-storage-persister/oxlint.config.ts new file mode 100644 index 00000000000..0352b334818 --- /dev/null +++ b/packages/query-sync-storage-persister/oxlint.config.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ extends: [rootConfig] }) diff --git a/packages/query-sync-storage-persister/package.json b/packages/query-sync-storage-persister/package.json index 036574cd7d0..34368c3dbf3 100644 --- a/packages/query-sync-storage-persister/package.json +++ b/packages/query-sync-storage-persister/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/query-sync-storage-persister/root.eslint.config.js b/packages/query-sync-storage-persister/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/query-sync-storage-persister/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/query-sync-storage-persister/root.oxlint.config.ts b/packages/query-sync-storage-persister/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/query-sync-storage-persister/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/query-test-utils/eslint.config.js b/packages/query-test-utils/eslint.config.js deleted file mode 100644 index 6c83db5a905..00000000000 --- a/packages/query-test-utils/eslint.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// @ts-check - -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig]) diff --git a/packages/query-test-utils/oxlint.config.ts b/packages/query-test-utils/oxlint.config.ts new file mode 100644 index 00000000000..0352b334818 --- /dev/null +++ b/packages/query-test-utils/oxlint.config.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ extends: [rootConfig] }) diff --git a/packages/query-test-utils/package.json b/packages/query-test-utils/package.json index 148c94ca5cc..f94b6ccbe77 100644 --- a/packages/query-test-utils/package.json +++ b/packages/query-test-utils/package.json @@ -27,7 +27,7 @@ }, "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:tscurrent": "tsc --project tsconfig.json --outDir .cache/test-types/tscurrent --tsBuildInfoFile .cache/test-types/tscurrent.tsbuildinfo", "test:types:ts70": "node ../../node_modules/typescript70/lib/tsc.js --project tsconfig.json --outDir .cache/test-types/ts70 --tsBuildInfoFile .cache/test-types/ts70.tsbuildinfo", diff --git a/packages/query-test-utils/root.eslint.config.js b/packages/query-test-utils/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/query-test-utils/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/query-test-utils/root.oxlint.config.ts b/packages/query-test-utils/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/query-test-utils/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/react-query-devtools/eslint.config.js b/packages/react-query-devtools/eslint.config.js deleted file mode 100644 index 78f0d91de65..00000000000 --- a/packages/react-query-devtools/eslint.config.js +++ /dev/null @@ -1,34 +0,0 @@ -// @ts-check - -import pluginReact from '@eslint-react/eslint-plugin' -import reactHooks from 'eslint-plugin-react-hooks' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - reactHooks.configs.flat.recommended, - pluginReact.configs.recommended, - { - rules: { - 'react-hooks/exhaustive-deps': 'error', - 'react-hooks/unsupported-syntax': 'error', - 'react-hooks/incompatible-library': 'error', - '@eslint-react/no-context-provider': 'off', // We need to be React 18 compatible - '@eslint-react/no-use-context': 'off', // We need to be React 18 compatible - // Covered by 'eslint-plugin-react-hooks' - '@eslint-react/error-boundaries': 'off', - '@eslint-react/exhaustive-deps': 'off', - '@eslint-react/globals': 'off', - '@eslint-react/immutability': 'off', - '@eslint-react/purity': 'off', - '@eslint-react/refs': 'off', - '@eslint-react/rules-of-hooks': 'off', - '@eslint-react/set-state-in-effect': 'off', - '@eslint-react/set-state-in-render': 'off', - '@eslint-react/static-components': 'off', - '@eslint-react/unsupported-syntax': 'off', - '@eslint-react/use-memo': 'off', - }, - }, -]) diff --git a/packages/react-query-devtools/oxlint.config.ts b/packages/react-query-devtools/oxlint.config.ts new file mode 100644 index 00000000000..7e535062d22 --- /dev/null +++ b/packages/react-query-devtools/oxlint.config.ts @@ -0,0 +1,42 @@ +import pluginReact from '@eslint-react/eslint-plugin' +import reactHooks from 'eslint-plugin-react-hooks' +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + jsPlugins: [ + // 'react-hooks' is reserved for Oxlint's native plugin, which lacks the React Compiler rules + { name: 'react-hooks-js', specifier: 'eslint-plugin-react-hooks' }, + '@eslint-react/eslint-plugin', + ], + rules: { + ...Object.fromEntries( + Object.entries(reactHooks.configs.flat.recommended.rules).map( + ([name, value]) => [ + name.replace(/^react-hooks\//, 'react-hooks-js/'), + value, + ], + ), + ), + ...pluginReact.configs.recommended.rules, + 'react-hooks-js/exhaustive-deps': 'error', + 'react-hooks-js/unsupported-syntax': 'error', + 'react-hooks-js/incompatible-library': 'error', + '@eslint-react/no-context-provider': 'off', // We need to be React 18 compatible + '@eslint-react/no-use-context': 'off', // We need to be React 18 compatible + // Covered by 'eslint-plugin-react-hooks' + '@eslint-react/error-boundaries': 'off', + '@eslint-react/exhaustive-deps': 'off', + '@eslint-react/globals': 'off', + '@eslint-react/immutability': 'off', + '@eslint-react/purity': 'off', + '@eslint-react/refs': 'off', + '@eslint-react/rules-of-hooks': 'off', + '@eslint-react/set-state-in-effect': 'off', + '@eslint-react/set-state-in-render': 'off', + '@eslint-react/static-components': 'off', + '@eslint-react/unsupported-syntax': 'off', + '@eslint-react/use-memo': 'off', + }, +}) diff --git a/packages/react-query-devtools/package.json b/packages/react-query-devtools/package.json index 521912f0a9c..74fb4aeb6e7 100644 --- a/packages/react-query-devtools/package.json +++ b/packages/react-query-devtools/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/react-query-devtools/root.eslint.config.js b/packages/react-query-devtools/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/react-query-devtools/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/react-query-devtools/root.oxlint.config.ts b/packages/react-query-devtools/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/react-query-devtools/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/react-query-next-experimental/eslint.config.js b/packages/react-query-next-experimental/eslint.config.js deleted file mode 100644 index 24ea6fcc8ba..00000000000 --- a/packages/react-query-next-experimental/eslint.config.js +++ /dev/null @@ -1,35 +0,0 @@ -// @ts-check - -import pluginReact from '@eslint-react/eslint-plugin' -import reactHooks from 'eslint-plugin-react-hooks' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - reactHooks.configs.flat.recommended, - pluginReact.configs.recommended, - { - rules: { - 'react-hooks/exhaustive-deps': 'error', - 'react-hooks/unsupported-syntax': 'error', - 'react-hooks/incompatible-library': 'error', - '@eslint-react/no-context-provider': 'off', // We need to be React 18 compatible - '@eslint-react/no-use-context': 'off', // We need to be React 18 compatible - '@eslint-react/dom-no-dangerously-set-innerhtml': 'off', - // Covered by 'eslint-plugin-react-hooks' - '@eslint-react/error-boundaries': 'off', - '@eslint-react/exhaustive-deps': 'off', - '@eslint-react/globals': 'off', - '@eslint-react/immutability': 'off', - '@eslint-react/purity': 'off', - '@eslint-react/refs': 'off', - '@eslint-react/rules-of-hooks': 'off', - '@eslint-react/set-state-in-effect': 'off', - '@eslint-react/set-state-in-render': 'off', - '@eslint-react/static-components': 'off', - '@eslint-react/unsupported-syntax': 'off', - '@eslint-react/use-memo': 'off', - }, - }, -]) diff --git a/packages/react-query-next-experimental/oxlint.config.ts b/packages/react-query-next-experimental/oxlint.config.ts new file mode 100644 index 00000000000..7de611241f1 --- /dev/null +++ b/packages/react-query-next-experimental/oxlint.config.ts @@ -0,0 +1,43 @@ +import pluginReact from '@eslint-react/eslint-plugin' +import reactHooks from 'eslint-plugin-react-hooks' +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + jsPlugins: [ + // 'react-hooks' is reserved for Oxlint's native plugin, which lacks the React Compiler rules + { name: 'react-hooks-js', specifier: 'eslint-plugin-react-hooks' }, + '@eslint-react/eslint-plugin', + ], + rules: { + ...Object.fromEntries( + Object.entries(reactHooks.configs.flat.recommended.rules).map( + ([name, value]) => [ + name.replace(/^react-hooks\//, 'react-hooks-js/'), + value, + ], + ), + ), + ...pluginReact.configs.recommended.rules, + 'react-hooks-js/exhaustive-deps': 'error', + 'react-hooks-js/unsupported-syntax': 'error', + 'react-hooks-js/incompatible-library': 'error', + '@eslint-react/no-context-provider': 'off', // We need to be React 18 compatible + '@eslint-react/no-use-context': 'off', // We need to be React 18 compatible + '@eslint-react/dom-no-dangerously-set-innerhtml': 'off', + // Covered by 'eslint-plugin-react-hooks' + '@eslint-react/error-boundaries': 'off', + '@eslint-react/exhaustive-deps': 'off', + '@eslint-react/globals': 'off', + '@eslint-react/immutability': 'off', + '@eslint-react/purity': 'off', + '@eslint-react/refs': 'off', + '@eslint-react/rules-of-hooks': 'off', + '@eslint-react/set-state-in-effect': 'off', + '@eslint-react/set-state-in-render': 'off', + '@eslint-react/static-components': 'off', + '@eslint-react/unsupported-syntax': 'off', + '@eslint-react/use-memo': 'off', + }, +}) diff --git a/packages/react-query-next-experimental/package.json b/packages/react-query-next-experimental/package.json index 9f5160deb35..4bb0c7596a2 100644 --- a/packages/react-query-next-experimental/package.json +++ b/packages/react-query-next-experimental/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/react-query-next-experimental/root.eslint.config.js b/packages/react-query-next-experimental/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/react-query-next-experimental/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/react-query-next-experimental/root.oxlint.config.ts b/packages/react-query-next-experimental/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/react-query-next-experimental/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/react-query-persist-client/eslint.config.js b/packages/react-query-persist-client/eslint.config.js deleted file mode 100644 index 78f0d91de65..00000000000 --- a/packages/react-query-persist-client/eslint.config.js +++ /dev/null @@ -1,34 +0,0 @@ -// @ts-check - -import pluginReact from '@eslint-react/eslint-plugin' -import reactHooks from 'eslint-plugin-react-hooks' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - reactHooks.configs.flat.recommended, - pluginReact.configs.recommended, - { - rules: { - 'react-hooks/exhaustive-deps': 'error', - 'react-hooks/unsupported-syntax': 'error', - 'react-hooks/incompatible-library': 'error', - '@eslint-react/no-context-provider': 'off', // We need to be React 18 compatible - '@eslint-react/no-use-context': 'off', // We need to be React 18 compatible - // Covered by 'eslint-plugin-react-hooks' - '@eslint-react/error-boundaries': 'off', - '@eslint-react/exhaustive-deps': 'off', - '@eslint-react/globals': 'off', - '@eslint-react/immutability': 'off', - '@eslint-react/purity': 'off', - '@eslint-react/refs': 'off', - '@eslint-react/rules-of-hooks': 'off', - '@eslint-react/set-state-in-effect': 'off', - '@eslint-react/set-state-in-render': 'off', - '@eslint-react/static-components': 'off', - '@eslint-react/unsupported-syntax': 'off', - '@eslint-react/use-memo': 'off', - }, - }, -]) diff --git a/packages/react-query-persist-client/oxlint.config.ts b/packages/react-query-persist-client/oxlint.config.ts new file mode 100644 index 00000000000..7e535062d22 --- /dev/null +++ b/packages/react-query-persist-client/oxlint.config.ts @@ -0,0 +1,42 @@ +import pluginReact from '@eslint-react/eslint-plugin' +import reactHooks from 'eslint-plugin-react-hooks' +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + jsPlugins: [ + // 'react-hooks' is reserved for Oxlint's native plugin, which lacks the React Compiler rules + { name: 'react-hooks-js', specifier: 'eslint-plugin-react-hooks' }, + '@eslint-react/eslint-plugin', + ], + rules: { + ...Object.fromEntries( + Object.entries(reactHooks.configs.flat.recommended.rules).map( + ([name, value]) => [ + name.replace(/^react-hooks\//, 'react-hooks-js/'), + value, + ], + ), + ), + ...pluginReact.configs.recommended.rules, + 'react-hooks-js/exhaustive-deps': 'error', + 'react-hooks-js/unsupported-syntax': 'error', + 'react-hooks-js/incompatible-library': 'error', + '@eslint-react/no-context-provider': 'off', // We need to be React 18 compatible + '@eslint-react/no-use-context': 'off', // We need to be React 18 compatible + // Covered by 'eslint-plugin-react-hooks' + '@eslint-react/error-boundaries': 'off', + '@eslint-react/exhaustive-deps': 'off', + '@eslint-react/globals': 'off', + '@eslint-react/immutability': 'off', + '@eslint-react/purity': 'off', + '@eslint-react/refs': 'off', + '@eslint-react/rules-of-hooks': 'off', + '@eslint-react/set-state-in-effect': 'off', + '@eslint-react/set-state-in-render': 'off', + '@eslint-react/static-components': 'off', + '@eslint-react/unsupported-syntax': 'off', + '@eslint-react/use-memo': 'off', + }, +}) diff --git a/packages/react-query-persist-client/package.json b/packages/react-query-persist-client/package.json index 2542854658a..c6c93f90619 100644 --- a/packages/react-query-persist-client/package.json +++ b/packages/react-query-persist-client/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/react-query-persist-client/root.eslint.config.js b/packages/react-query-persist-client/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/react-query-persist-client/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/react-query-persist-client/root.oxlint.config.ts b/packages/react-query-persist-client/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/react-query-persist-client/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/react-query/eslint.config.js b/packages/react-query/eslint.config.js deleted file mode 100644 index 44a38d3783b..00000000000 --- a/packages/react-query/eslint.config.js +++ /dev/null @@ -1,40 +0,0 @@ -// @ts-check - -import pluginReact from '@eslint-react/eslint-plugin' -import reactHooks from 'eslint-plugin-react-hooks' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - reactHooks.configs.flat.recommended, - pluginReact.configs.recommended, - { - rules: { - 'react-hooks/exhaustive-deps': 'error', - 'react-hooks/unsupported-syntax': 'error', - 'react-hooks/incompatible-library': 'error', - '@eslint-react/no-context-provider': 'off', // We need to be React 18 compatible - '@eslint-react/no-use-context': 'off', // We need to be React 18 compatible - // Covered by 'eslint-plugin-react-hooks' - '@eslint-react/error-boundaries': 'off', - '@eslint-react/exhaustive-deps': 'off', - '@eslint-react/globals': 'off', - '@eslint-react/immutability': 'off', - '@eslint-react/purity': 'off', - '@eslint-react/refs': 'off', - '@eslint-react/rules-of-hooks': 'off', - '@eslint-react/set-state-in-effect': 'off', - '@eslint-react/set-state-in-render': 'off', - '@eslint-react/static-components': 'off', - '@eslint-react/unsupported-syntax': 'off', - '@eslint-react/use-memo': 'off', - }, - }, - { - files: ['**/__tests__/**'], - rules: { - '@typescript-eslint/no-unnecessary-condition': 'off', - }, - }, -]) diff --git a/packages/react-query/oxlint.config.ts b/packages/react-query/oxlint.config.ts new file mode 100644 index 00000000000..c36848ca2da --- /dev/null +++ b/packages/react-query/oxlint.config.ts @@ -0,0 +1,50 @@ +import pluginReact from '@eslint-react/eslint-plugin' +import reactHooks from 'eslint-plugin-react-hooks' +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + jsPlugins: [ + // 'react-hooks' is reserved for Oxlint's native plugin, which lacks the React Compiler rules + { name: 'react-hooks-js', specifier: 'eslint-plugin-react-hooks' }, + '@eslint-react/eslint-plugin', + ], + rules: { + ...Object.fromEntries( + Object.entries(reactHooks.configs.flat.recommended.rules).map( + ([name, value]) => [ + name.replace(/^react-hooks\//, 'react-hooks-js/'), + value, + ], + ), + ), + ...pluginReact.configs.recommended.rules, + 'react-hooks-js/exhaustive-deps': 'error', + 'react-hooks-js/unsupported-syntax': 'error', + 'react-hooks-js/incompatible-library': 'error', + '@eslint-react/no-context-provider': 'off', // We need to be React 18 compatible + '@eslint-react/no-use-context': 'off', // We need to be React 18 compatible + // Covered by 'eslint-plugin-react-hooks' + '@eslint-react/error-boundaries': 'off', + '@eslint-react/exhaustive-deps': 'off', + '@eslint-react/globals': 'off', + '@eslint-react/immutability': 'off', + '@eslint-react/purity': 'off', + '@eslint-react/refs': 'off', + '@eslint-react/rules-of-hooks': 'off', + '@eslint-react/set-state-in-effect': 'off', + '@eslint-react/set-state-in-render': 'off', + '@eslint-react/static-components': 'off', + '@eslint-react/unsupported-syntax': 'off', + '@eslint-react/use-memo': 'off', + }, + overrides: [ + { + files: ['**/__tests__/**'], + rules: { + 'typescript/no-unnecessary-condition': 'off', + }, + }, + ], +}) diff --git a/packages/react-query/package.json b/packages/react-query/package.json index f7c4eae0f6c..cbde89391ac 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/react-query/root.eslint.config.js b/packages/react-query/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/react-query/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/react-query/root.oxlint.config.ts b/packages/react-query/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/react-query/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/react-query/src/HydrationBoundary.tsx b/packages/react-query/src/HydrationBoundary.tsx index f81d164e0e9..4dee1bfbdd0 100644 --- a/packages/react-query/src/HydrationBoundary.tsx +++ b/packages/react-query/src/HydrationBoundary.tsx @@ -150,7 +150,7 @@ export const HydrationBoundary = ({ if (newQueries.length > 0) { // It's actually fine to call this with queries/state that already exists // in the cache, or is older. hydrate() is idempotent for queries. - // eslint-disable-next-line react-hooks/refs + // eslint-disable-next-line react-hooks-js/refs hydrate(client, { queries: newQueries }, optionsRef.current) } if (existingQueries.length > 0) { diff --git a/packages/react-query/src/__tests__/infiniteQueryOptions.test-d.tsx b/packages/react-query/src/__tests__/infiniteQueryOptions.test-d.tsx index ac2d7ede927..43ff00e3543 100644 --- a/packages/react-query/src/__tests__/infiniteQueryOptions.test-d.tsx +++ b/packages/react-query/src/__tests__/infiniteQueryOptions.test-d.tsx @@ -157,7 +157,7 @@ describe('infiniteQueryOptions', () => { initialPageParam: 1, }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() @@ -171,7 +171,7 @@ describe('infiniteQueryOptions', () => { select: (data) => data.pages, }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() @@ -275,17 +275,17 @@ describe('infiniteQueryOptions', () => { // deprecated methods to be removed in v6 assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchQuery(options), ) }) diff --git a/packages/react-query/src/__tests__/queryOptions.test-d.tsx b/packages/react-query/src/__tests__/queryOptions.test-d.tsx index f972dd13682..68285671b24 100644 --- a/packages/react-query/src/__tests__/queryOptions.test-d.tsx +++ b/packages/react-query/src/__tests__/queryOptions.test-d.tsx @@ -74,7 +74,7 @@ describe('queryOptions', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) @@ -114,7 +114,7 @@ describe('queryOptions', () => { select: (data) => data.toString(), }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) diff --git a/packages/react-query/src/__tests__/useInfiniteQuery.test-d.tsx b/packages/react-query/src/__tests__/useInfiniteQuery.test-d.tsx index 714132ac02a..126ce6ac582 100644 --- a/packages/react-query/src/__tests__/useInfiniteQuery.test-d.tsx +++ b/packages/react-query/src/__tests__/useInfiniteQuery.test-d.tsx @@ -30,7 +30,7 @@ describe('pageParam', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for fetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { @@ -54,7 +54,7 @@ describe('pageParam', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for prefetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { diff --git a/packages/react-query/src/__tests__/utils.tsx b/packages/react-query/src/__tests__/utils.tsx index 403f2b1fced..82ddcd39684 100644 --- a/packages/react-query/src/__tests__/utils.tsx +++ b/packages/react-query/src/__tests__/utils.tsx @@ -32,7 +32,7 @@ export function Blink({ const [shouldShow, setShouldShow] = React.useState(true) React.useEffect(() => { - // eslint-disable-next-line react-hooks/set-state-in-effect + // eslint-disable-next-line react-hooks-js/set-state-in-effect setShouldShow(true) const timeout = setActTimeout(() => setShouldShow(false), duration) return () => { diff --git a/packages/solid-query-devtools/eslint.config.js b/packages/solid-query-devtools/eslint.config.js deleted file mode 100644 index c5abe651072..00000000000 --- a/packages/solid-query-devtools/eslint.config.js +++ /dev/null @@ -1,15 +0,0 @@ -// @ts-check - -import pluginSolid from 'eslint-plugin-solid/configs/typescript' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - pluginSolid, - { - rules: { - 'solid/reactivity': 'off', // Reads signals outside tracked scopes on purpose (initial snapshots, subscription callbacks) - }, - }, -]) diff --git a/packages/solid-query-devtools/oxlint.config.ts b/packages/solid-query-devtools/oxlint.config.ts new file mode 100644 index 00000000000..0f78f6ff9ac --- /dev/null +++ b/packages/solid-query-devtools/oxlint.config.ts @@ -0,0 +1,12 @@ +import pluginSolid from 'eslint-plugin-solid/configs/typescript' +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + jsPlugins: ['eslint-plugin-solid'], + rules: { + ...pluginSolid.rules, + 'solid/reactivity': 'off', // Reads signals outside tracked scopes on purpose (initial snapshots, subscription callbacks) + }, +}) diff --git a/packages/solid-query-devtools/package.json b/packages/solid-query-devtools/package.json index 7a8e2b49174..2abd8338e04 100644 --- a/packages/solid-query-devtools/package.json +++ b/packages/solid-query-devtools/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/solid-query-devtools/root.eslint.config.js b/packages/solid-query-devtools/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/solid-query-devtools/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/solid-query-devtools/root.oxlint.config.ts b/packages/solid-query-devtools/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/solid-query-devtools/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/solid-query-persist-client/eslint.config.js b/packages/solid-query-persist-client/eslint.config.js deleted file mode 100644 index 832d32fa1e1..00000000000 --- a/packages/solid-query-persist-client/eslint.config.js +++ /dev/null @@ -1,7 +0,0 @@ -// @ts-check - -import pluginSolid from 'eslint-plugin-solid/configs/typescript' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig, pluginSolid]) diff --git a/packages/solid-query-persist-client/oxlint.config.ts b/packages/solid-query-persist-client/oxlint.config.ts new file mode 100644 index 00000000000..80b74f04a80 --- /dev/null +++ b/packages/solid-query-persist-client/oxlint.config.ts @@ -0,0 +1,11 @@ +import pluginSolid from 'eslint-plugin-solid/configs/typescript' +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + jsPlugins: ['eslint-plugin-solid'], + rules: { + ...pluginSolid.rules, + }, +}) diff --git a/packages/solid-query-persist-client/package.json b/packages/solid-query-persist-client/package.json index c536de86150..ce50511cf6c 100644 --- a/packages/solid-query-persist-client/package.json +++ b/packages/solid-query-persist-client/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/solid-query-persist-client/root.eslint.config.js b/packages/solid-query-persist-client/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/solid-query-persist-client/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/solid-query-persist-client/root.oxlint.config.ts b/packages/solid-query-persist-client/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/solid-query-persist-client/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/solid-query/eslint.config.js b/packages/solid-query/eslint.config.js deleted file mode 100644 index c5abe651072..00000000000 --- a/packages/solid-query/eslint.config.js +++ /dev/null @@ -1,15 +0,0 @@ -// @ts-check - -import pluginSolid from 'eslint-plugin-solid/configs/typescript' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([ - ...rootConfig, - pluginSolid, - { - rules: { - 'solid/reactivity': 'off', // Reads signals outside tracked scopes on purpose (initial snapshots, subscription callbacks) - }, - }, -]) diff --git a/packages/solid-query/oxlint.config.ts b/packages/solid-query/oxlint.config.ts new file mode 100644 index 00000000000..0f78f6ff9ac --- /dev/null +++ b/packages/solid-query/oxlint.config.ts @@ -0,0 +1,12 @@ +import pluginSolid from 'eslint-plugin-solid/configs/typescript' +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + jsPlugins: ['eslint-plugin-solid'], + rules: { + ...pluginSolid.rules, + 'solid/reactivity': 'off', // Reads signals outside tracked scopes on purpose (initial snapshots, subscription callbacks) + }, +}) diff --git a/packages/solid-query/package.json b/packages/solid-query/package.json index 3f854af5fbe..d31185cf90f 100644 --- a/packages/solid-query/package.json +++ b/packages/solid-query/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", diff --git a/packages/solid-query/root.eslint.config.js b/packages/solid-query/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/solid-query/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/solid-query/root.oxlint.config.ts b/packages/solid-query/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/solid-query/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/solid-query/src/__tests__/queryOptions.test-d.tsx b/packages/solid-query/src/__tests__/queryOptions.test-d.tsx index 468c5e8d0a6..244945b7d49 100644 --- a/packages/solid-query/src/__tests__/queryOptions.test-d.tsx +++ b/packages/solid-query/src/__tests__/queryOptions.test-d.tsx @@ -91,7 +91,7 @@ describe('queryOptions', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) diff --git a/packages/solid-query/src/__tests__/useInfiniteQuery.test-d.tsx b/packages/solid-query/src/__tests__/useInfiniteQuery.test-d.tsx index 090dedf2cef..5de08b99b73 100644 --- a/packages/solid-query/src/__tests__/useInfiniteQuery.test-d.tsx +++ b/packages/solid-query/src/__tests__/useInfiniteQuery.test-d.tsx @@ -30,7 +30,7 @@ describe('useInfiniteQuery', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for fetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { @@ -42,7 +42,7 @@ describe('useInfiniteQuery', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for prefetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { diff --git a/packages/svelte-query-devtools/eslint.config.js b/packages/svelte-query-devtools/eslint.config.js index c6e0d4fea5f..4f38a850e3c 100644 --- a/packages/svelte-query-devtools/eslint.config.js +++ b/packages/svelte-query-devtools/eslint.config.js @@ -3,11 +3,10 @@ import tsParser from '@typescript-eslint/parser' import pluginSvelte from 'eslint-plugin-svelte' import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' import svelteConfig from './svelte.config.js' +// Only the Svelte rules, which need the component template; everything else is linted by Oxlint export default defineConfig([ - ...rootConfig, ...pluginSvelte.configs['recommended'], { files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], diff --git a/packages/svelte-query-devtools/oxlint.config.ts b/packages/svelte-query-devtools/oxlint.config.ts new file mode 100644 index 00000000000..59b166ea6ff --- /dev/null +++ b/packages/svelte-query-devtools/oxlint.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + overrides: [ + { + // TODO: These were never applied to Svelte components by ESLint + files: ['**/*.svelte'], + rules: { + 'import-js/order': 'off', + 'import/no-duplicates': 'off', + }, + }, + ], +}) diff --git a/packages/svelte-query-devtools/package.json b/packages/svelte-query-devtools/package.json index a8015baf09a..d9db1100d61 100644 --- a/packages/svelte-query-devtools/package.json +++ b/packages/svelte-query-devtools/package.json @@ -29,6 +29,7 @@ "test:types:ts59": "node -e \"const Module = require('module'); const resolveFilename = Module._resolveFilename; let swapped = false; Module._resolveFilename = function (request, ...args) { if (request === 'typescript' || request.startsWith('typescript/')) { request = request.replace('typescript', 'typescript59'); swapped = true } return resolveFilename.call(this, request, ...args) }; process.on('exit', () => { if (!swapped) { console.error('svelte-check did not load typescript59'); process.exitCode = 1 } }); process.argv.splice(1, 0, ''); require('svelte-check/bin/svelte-check')\" -- --tsconfig ./tsconfig.legacy.json", "test:types:tscurrent": "svelte-check --tsconfig ./tsconfig.json", "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm run test:lib --watch", "test:build": "publint --strict && attw --pack", diff --git a/packages/svelte-query-devtools/root.eslint.config.js b/packages/svelte-query-devtools/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/svelte-query-devtools/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/svelte-query-devtools/root.oxlint.config.ts b/packages/svelte-query-devtools/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/svelte-query-devtools/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/svelte-query-persist-client/eslint.config.js b/packages/svelte-query-persist-client/eslint.config.js index c6e0d4fea5f..4f38a850e3c 100644 --- a/packages/svelte-query-persist-client/eslint.config.js +++ b/packages/svelte-query-persist-client/eslint.config.js @@ -3,11 +3,10 @@ import tsParser from '@typescript-eslint/parser' import pluginSvelte from 'eslint-plugin-svelte' import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' import svelteConfig from './svelte.config.js' +// Only the Svelte rules, which need the component template; everything else is linted by Oxlint export default defineConfig([ - ...rootConfig, ...pluginSvelte.configs['recommended'], { files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], diff --git a/packages/svelte-query-persist-client/oxlint.config.ts b/packages/svelte-query-persist-client/oxlint.config.ts new file mode 100644 index 00000000000..59b166ea6ff --- /dev/null +++ b/packages/svelte-query-persist-client/oxlint.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + overrides: [ + { + // TODO: These were never applied to Svelte components by ESLint + files: ['**/*.svelte'], + rules: { + 'import-js/order': 'off', + 'import/no-duplicates': 'off', + }, + }, + ], +}) diff --git a/packages/svelte-query-persist-client/package.json b/packages/svelte-query-persist-client/package.json index 6fb1765777a..68affb2c9f7 100644 --- a/packages/svelte-query-persist-client/package.json +++ b/packages/svelte-query-persist-client/package.json @@ -29,6 +29,7 @@ "test:types:ts59": "node -e \"const Module = require('module'); const resolveFilename = Module._resolveFilename; let swapped = false; Module._resolveFilename = function (request, ...args) { if (request === 'typescript' || request.startsWith('typescript/')) { request = request.replace('typescript', 'typescript59'); swapped = true } return resolveFilename.call(this, request, ...args) }; process.on('exit', () => { if (!swapped) { console.error('svelte-check did not load typescript59'); process.exitCode = 1 } }); process.argv.splice(1, 0, ''); require('svelte-check/bin/svelte-check')\" -- --tsconfig ./tsconfig.legacy.json", "test:types:tscurrent": "svelte-check --tsconfig ./tsconfig.json", "test:eslint": "eslint --concurrency=auto ./src ./tests", + "test:oxlint": "oxlint ./src ./tests", "test:lib": "vitest", "test:lib:dev": "pnpm run test:lib --watch", "test:build": "publint --strict && attw --pack", diff --git a/packages/svelte-query-persist-client/root.eslint.config.js b/packages/svelte-query-persist-client/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/svelte-query-persist-client/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/svelte-query-persist-client/root.oxlint.config.ts b/packages/svelte-query-persist-client/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/svelte-query-persist-client/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/svelte-query/eslint.config.js b/packages/svelte-query/eslint.config.js index 05fa3fbc450..4f38a850e3c 100644 --- a/packages/svelte-query/eslint.config.js +++ b/packages/svelte-query/eslint.config.js @@ -3,11 +3,10 @@ import tsParser from '@typescript-eslint/parser' import pluginSvelte from 'eslint-plugin-svelte' import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' import svelteConfig from './svelte.config.js' +// Only the Svelte rules, which need the component template; everything else is linted by Oxlint export default defineConfig([ - ...rootConfig, ...pluginSvelte.configs['recommended'], { files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], @@ -18,10 +17,6 @@ export default defineConfig([ svelteConfig, }, }, - rules: { - // Svelte runes and proxy state produce false positives for this rule. - '@typescript-eslint/no-unnecessary-condition': 'off', - }, }, { rules: { diff --git a/packages/svelte-query/oxlint.config.ts b/packages/svelte-query/oxlint.config.ts new file mode 100644 index 00000000000..af0e55147dc --- /dev/null +++ b/packages/svelte-query/oxlint.config.ts @@ -0,0 +1,23 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + overrides: [ + { + // TODO: These were never applied to Svelte components by ESLint + files: ['**/*.svelte'], + rules: { + 'import-js/order': 'off', + 'import/no-duplicates': 'off', + }, + }, + { + files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], + rules: { + // Svelte runes and proxy state produce false positives for this rule. + 'typescript/no-unnecessary-condition': 'off', + }, + }, + ], +}) diff --git a/packages/svelte-query/package.json b/packages/svelte-query/package.json index a9cb991add9..ace8b6644ab 100644 --- a/packages/svelte-query/package.json +++ b/packages/svelte-query/package.json @@ -29,6 +29,7 @@ "test:types:ts59": "node -e \"const Module = require('module'); const resolveFilename = Module._resolveFilename; let swapped = false; Module._resolveFilename = function (request, ...args) { if (request === 'typescript' || request.startsWith('typescript/')) { request = request.replace('typescript', 'typescript59'); swapped = true } return resolveFilename.call(this, request, ...args) }; process.on('exit', () => { if (!swapped) { console.error('svelte-check did not load typescript59'); process.exitCode = 1 } }); process.argv.splice(1, 0, ''); require('svelte-check/bin/svelte-check')\" -- --tsconfig ./tsconfig.legacy.json", "test:types:tscurrent": "svelte-check --tsconfig ./tsconfig.json", "test:eslint": "eslint --concurrency=auto ./src ./tests", + "test:oxlint": "oxlint ./src ./tests", "test:lib": "vitest", "test:lib:dev": "pnpm run test:lib --watch", "test:build": "publint --strict && attw --pack", diff --git a/packages/svelte-query/root.eslint.config.js b/packages/svelte-query/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/svelte-query/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/svelte-query/root.oxlint.config.ts b/packages/svelte-query/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/svelte-query/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts b/packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts index c5c37d27063..6e4524ffbb8 100644 --- a/packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts +++ b/packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts @@ -30,7 +30,7 @@ describe('createInfiniteQuery', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for fetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { @@ -42,7 +42,7 @@ describe('createInfiniteQuery', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for prefetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { diff --git a/packages/svelte-query/tests/infiniteQueryOptions.test-d.ts b/packages/svelte-query/tests/infiniteQueryOptions.test-d.ts index 79366739c47..ca2a3196863 100644 --- a/packages/svelte-query/tests/infiniteQueryOptions.test-d.ts +++ b/packages/svelte-query/tests/infiniteQueryOptions.test-d.ts @@ -129,7 +129,7 @@ describe('infiniteQueryOptions', () => { initialPageParam: 1, }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() diff --git a/packages/svelte-query/tests/queryOptions.test-d.ts b/packages/svelte-query/tests/queryOptions.test-d.ts index 9201eb5097d..283361abc69 100644 --- a/packages/svelte-query/tests/queryOptions.test-d.ts +++ b/packages/svelte-query/tests/queryOptions.test-d.ts @@ -85,7 +85,7 @@ describe('queryOptions', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) diff --git a/packages/vue-query-devtools/eslint.config.js b/packages/vue-query-devtools/eslint.config.js deleted file mode 100644 index 309c76ef7b7..00000000000 --- a/packages/vue-query-devtools/eslint.config.js +++ /dev/null @@ -1,7 +0,0 @@ -// @ts-check - -import pluginVue from 'eslint-plugin-vue' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig, ...pluginVue.configs['flat/base']]) diff --git a/packages/vue-query-devtools/oxlint.config.ts b/packages/vue-query-devtools/oxlint.config.ts new file mode 100644 index 00000000000..0352b334818 --- /dev/null +++ b/packages/vue-query-devtools/oxlint.config.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ extends: [rootConfig] }) diff --git a/packages/vue-query-devtools/package.json b/packages/vue-query-devtools/package.json index b8544360c43..40d4af396d0 100644 --- a/packages/vue-query-devtools/package.json +++ b/packages/vue-query-devtools/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "vue-tsc --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "npm-run-all --serial test:types:*", "test:types:ts56": "node -e \"process.argv.splice(1, 0, ''); require('vue-tsc').run(require.resolve('typescript56/lib/tsc'))\" -- --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node -e \"process.argv.splice(1, 0, ''); require('vue-tsc').run(require.resolve('typescript57/lib/tsc'))\" -- --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", @@ -55,7 +55,6 @@ }, "devDependencies": { "@tanstack/vue-query": "workspace:*", - "eslint-plugin-vue": "catalog:", "typescript": "catalog:", "unplugin-vue": "catalog:", "vue": "catalog:", diff --git a/packages/vue-query-devtools/root.eslint.config.js b/packages/vue-query-devtools/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/vue-query-devtools/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/vue-query-devtools/root.oxlint.config.ts b/packages/vue-query-devtools/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/vue-query-devtools/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/vue-query/eslint.config.js b/packages/vue-query/eslint.config.js deleted file mode 100644 index 309c76ef7b7..00000000000 --- a/packages/vue-query/eslint.config.js +++ /dev/null @@ -1,7 +0,0 @@ -// @ts-check - -import pluginVue from 'eslint-plugin-vue' -import { defineConfig } from 'eslint/config' -import rootConfig from './root.eslint.config.js' - -export default defineConfig([...rootConfig, ...pluginVue.configs['flat/base']]) diff --git a/packages/vue-query/oxlint.config.ts b/packages/vue-query/oxlint.config.ts new file mode 100644 index 00000000000..0352b334818 --- /dev/null +++ b/packages/vue-query/oxlint.config.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'oxlint' +import rootConfig from './root.oxlint.config.ts' + +export default defineConfig({ extends: [rootConfig] }) diff --git a/packages/vue-query/package.json b/packages/vue-query/package.json index 5e3ec02d5cb..6834d7952da 100644 --- a/packages/vue-query/package.json +++ b/packages/vue-query/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types", "compile": "node ../../node_modules/typescript/lib/tsc.js --project tsconfig.json", - "test:eslint": "eslint --concurrency=auto ./src", + "test:oxlint": "oxlint ./src", "test:types": "vue-demi-switch 3 && npm-run-all --serial test:types:*", "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts56 --tsBuildInfoFile .cache/test-types/ts56.tsbuildinfo", "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --project tsconfig.legacy.json --outDir .cache/test-types/ts57 --tsBuildInfoFile .cache/test-types/ts57.tsbuildinfo", @@ -66,7 +66,6 @@ "devDependencies": { "@tanstack/query-test-utils": "workspace:*", "@vue/composition-api": "1.7.2", - "eslint-plugin-vue": "catalog:", "typescript": "catalog:", "unplugin-vue": "catalog:", "vue": "catalog:", diff --git a/packages/vue-query/root.eslint.config.js b/packages/vue-query/root.eslint.config.js deleted file mode 120000 index 35dedbe5a4a..00000000000 --- a/packages/vue-query/root.eslint.config.js +++ /dev/null @@ -1 +0,0 @@ -../../eslint.config.js \ No newline at end of file diff --git a/packages/vue-query/root.oxlint.config.ts b/packages/vue-query/root.oxlint.config.ts new file mode 120000 index 00000000000..56565c65534 --- /dev/null +++ b/packages/vue-query/root.oxlint.config.ts @@ -0,0 +1 @@ +../../oxlint.config.ts \ No newline at end of file diff --git a/packages/vue-query/src/__tests__/queryClient.test-d.ts b/packages/vue-query/src/__tests__/queryClient.test-d.ts index a973cabdd22..9c6b5fc8ca8 100644 --- a/packages/vue-query/src/__tests__/queryClient.test-d.ts +++ b/packages/vue-query/src/__tests__/queryClient.test-d.ts @@ -115,7 +115,7 @@ describe('setQueryData', () => { describe('fetchInfiniteQuery', () => { it('should allow passing pages', async () => { const key = queryKey() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery({ queryKey: key, queryFn: () => Promise.resolve('string'), diff --git a/packages/vue-query/src/__tests__/queryClient.test.ts b/packages/vue-query/src/__tests__/queryClient.test.ts index ed281e4822e..f2010cb0ff5 100644 --- a/packages/vue-query/src/__tests__/queryClient.test.ts +++ b/packages/vue-query/src/__tests__/queryClient.test.ts @@ -101,7 +101,7 @@ describe('QueryCache', () => { it('should properly unwrap parameter', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: queryKeyRef, queryFn: fn, @@ -364,7 +364,7 @@ describe('QueryCache', () => { it('should properly unwrap parameter', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery({ queryKey: queryKeyRef, }) @@ -424,7 +424,7 @@ describe('QueryCache', () => { it('should properly unwrap parameters', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchQuery({ queryKey: queryKeyRef, queryFn: fn }) expect(QueryClientOrigin.prototype.prefetchQuery).toHaveBeenCalledWith({ @@ -438,7 +438,7 @@ describe('QueryCache', () => { it('should properly unwrap parameter', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKeyRef, initialPageParam: 0, @@ -462,7 +462,7 @@ describe('QueryCache', () => { getNextPageParam: () => 12, }) - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery(options) expect( @@ -532,7 +532,7 @@ describe('QueryCache', () => { it('should properly unwrap parameters', () => { const queryClient = new QueryClient() - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKeyRef, queryFn: fn, diff --git a/packages/vue-query/src/__tests__/queryOptions.test-d.ts b/packages/vue-query/src/__tests__/queryOptions.test-d.ts index f4cfe44f4df..e303edacc20 100644 --- a/packages/vue-query/src/__tests__/queryOptions.test-d.ts +++ b/packages/vue-query/src/__tests__/queryOptions.test-d.ts @@ -163,7 +163,7 @@ describe('queryOptions', () => { // Should not error const data = queryClient.invalidateQueries(options) // Should not error - // eslint-disable-next-line no-restricted-syntax -- grandfathered direct test + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data2 = queryClient.fetchQuery(options) expectTypeOf(data).toEqualTypeOf>() diff --git a/packages/vue-query/src/__tests__/useMutation.test.ts b/packages/vue-query/src/__tests__/useMutation.test.ts index 04aecacaad0..091c2b419c2 100644 --- a/packages/vue-query/src/__tests__/useMutation.test.ts +++ b/packages/vue-query/src/__tests__/useMutation.test.ts @@ -174,8 +174,10 @@ describe('useMutation', () => { }) expect( - (relevantMutation?.options.mutationKey as Array)[0] - ?.otherObject.name === 'someOtherObjectName', + ( + relevantMutation?.options.mutationKey as + Array | undefined + )?.[0]?.otherObject.name === 'someOtherObjectName', ).toBe(true) }) diff --git a/packages/vue-query/src/queryClient.ts b/packages/vue-query/src/queryClient.ts index 3c2fb4f70d6..39078fd2caf 100644 --- a/packages/vue-query/src/queryClient.ts +++ b/packages/vue-query/src/queryClient.ts @@ -118,7 +118,7 @@ export class QueryClient extends QC { EnsureQueryDataOptions >, ): Promise { - // eslint-disable-next-line no-restricted-syntax -- grandfathered deprecated wrapper implementation + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.ensureQueryData(cloneDeepUnref(options)) } @@ -366,7 +366,7 @@ export class QueryClient extends QC { FetchQueryOptions >, ): Promise { - // eslint-disable-next-line no-restricted-syntax -- grandfathered deprecated wrapper implementation + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.fetchQuery(cloneDeepUnref(options)) } @@ -401,7 +401,7 @@ export class QueryClient extends QC { FetchQueryOptions >, ): Promise { - // eslint-disable-next-line no-restricted-syntax -- grandfathered deprecated wrapper implementation + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.prefetchQuery(cloneDeepUnref(options)) } @@ -523,7 +523,7 @@ export class QueryClient extends QC { > >, ): Promise> { - // eslint-disable-next-line no-restricted-syntax -- grandfathered deprecated wrapper implementation + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.fetchInfiniteQuery(cloneDeepUnref(options)) } @@ -579,7 +579,7 @@ export class QueryClient extends QC { > >, ): Promise { - // eslint-disable-next-line no-restricted-syntax -- grandfathered deprecated wrapper implementation + // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.prefetchInfiniteQuery(cloneDeepUnref(options)) } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c47bad96af..85f7070a5ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -218,9 +218,6 @@ catalogs: eslint: specifier: ^9.36.0 version: 9.39.4 - eslint-config-preact: - specifier: ^2.0.0 - version: 2.0.0 eslint-plugin-react-hooks: specifier: ^7.1.1 version: 7.1.1 @@ -230,9 +227,6 @@ catalogs: eslint-plugin-svelte: specifier: ^3.23.0 version: 3.23.0 - eslint-plugin-vue: - specifier: ^10.11.1 - version: 10.11.1 preact: specifier: ^10.29.8 version: 10.29.8 @@ -293,6 +287,9 @@ importers: '@size-limit/preset-small-lib': specifier: ^14.0.0 version: 14.0.0(size-limit@14.0.0) + '@stylistic/eslint-plugin': + specifier: ^5.10.0 + version: 5.10.0(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0)) '@tanstack/eslint-config': specifier: 0.4.0 version: 0.4.0(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) @@ -308,12 +305,12 @@ importers: '@vitest/coverage-istanbul': specifier: 4.1.11 version: 4.1.11(supports-color@7.2.0)(vitest@4.1.11) - '@vitest/eslint-plugin': - specifier: ^1.6.27 - version: 1.6.27(@typescript-eslint/eslint-plugin@8.58.1(@typescript-eslint/parser@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)(vitest@4.1.11) eslint: specifier: 'catalog:' version: 9.39.4(jiti@2.7.0)(supports-color@7.2.0) + eslint-plugin-import-x: + specifier: ^4.17.1 + version: 4.17.1(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) eslint-plugin-jsdoc: specifier: ^65.0.1 version: 65.0.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) @@ -332,6 +329,12 @@ importers: nx: specifier: 23.2.1 version: 23.2.1 + oxlint: + specifier: ^1.87.0 + version: 1.87.0(oxlint-tsgolint@7.0.2003) + oxlint-tsgolint: + specifier: ^7.0.2003 + version: 7.0.2003 premove: specifier: ^4.0.0 version: 4.0.0 @@ -2840,12 +2843,6 @@ importers: '@testing-library/preact': specifier: 'catalog:' version: 3.2.4(preact@10.29.8) - '@typescript-eslint/parser': - specifier: 'catalog:' - version: 8.71.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3) - eslint-config-preact: - specifier: 'catalog:' - version: 2.0.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) preact: specifier: 'catalog:' version: 10.29.8(preact-render-to-string@6.6.7) @@ -2871,12 +2868,6 @@ importers: '@testing-library/preact': specifier: 'catalog:' version: 3.2.4(preact@10.29.8) - '@typescript-eslint/parser': - specifier: 'catalog:' - version: 8.71.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3) - eslint-config-preact: - specifier: 'catalog:' - version: 2.0.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) preact: specifier: 'catalog:' version: 10.29.8(preact-render-to-string@6.6.7) @@ -2902,12 +2893,6 @@ importers: '@testing-library/preact': specifier: 'catalog:' version: 3.2.4(preact@10.29.8) - '@typescript-eslint/parser': - specifier: 'catalog:' - version: 8.71.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3) - eslint-config-preact: - specifier: 'catalog:' - version: 2.0.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) preact: specifier: 'catalog:' version: 10.29.8(preact-render-to-string@6.6.7) @@ -3413,9 +3398,6 @@ importers: '@vue/composition-api': specifier: 1.7.2 version: 1.7.2(vue@3.5.43(typescript@6.0.3)) - eslint-plugin-vue: - specifier: 'catalog:' - version: 10.11.1(@stylistic/eslint-plugin@5.10.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2)))(@typescript-eslint/parser@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(vue-eslint-parser@10.4.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)) typescript: specifier: 'catalog:' version: 6.0.3 @@ -3441,9 +3423,6 @@ importers: '@tanstack/vue-query': specifier: workspace:* version: link:../vue-query - eslint-plugin-vue: - specifier: 'catalog:' - version: 10.11.1(@stylistic/eslint-plugin@5.10.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2)))(@typescript-eslint/parser@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(vue-eslint-parser@10.4.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)) typescript: specifier: 'catalog:' version: 6.0.3 @@ -7107,8 +7086,157 @@ packages: cpu: [x64] os: [win32] - '@package-json/types@0.0.12': - resolution: {integrity: sha512-uu43FGU34B5VM9mCNjXCwLaGHYjXdNincqKLaraaCW+7S2+SmiBg1Nv8bPnmschrIfZmfKNY9f3fC376MRrObw==} + '@oxlint-tsgolint/darwin-arm64@7.0.2003': + resolution: {integrity: sha512-TgV33rXr6ueXBwvc+0nssUkTBSXHJxv77I8p4RCjDjCnvexHtmoPiudVRDfj3S3puMDdeQdHW6jdUgUPy3nr/w==} + cpu: [arm64] + os: [darwin] + + '@oxlint-tsgolint/darwin-x64@7.0.2003': + resolution: {integrity: sha512-hY3FMAjIaPDdK3FNxyRXRfHPOFeoBn6dmnLyKZgQ2IbTTD1adXhl6PfCIqHhCPvurigv7nf7mYuWZZ19MmJzmg==} + cpu: [x64] + os: [darwin] + + '@oxlint-tsgolint/linux-arm64@7.0.2003': + resolution: {integrity: sha512-eAET4JpyfBbg8SO0K74o4R55tEjVC292pIyxGOw2XGf8x/HrPNyxwQ478jMYOM54FIVOHc8sJ6VRHxluy6lucw==} + cpu: [arm64] + os: [linux] + + '@oxlint-tsgolint/linux-x64@7.0.2003': + resolution: {integrity: sha512-GXdyO/XyqDJ3s/llR/oOktLsYNjZtWSQBy0JMc+/0gsNPvTcseKPhn9c6KcFyWmnr6H4vljYALbujonqSzzEGw==} + cpu: [x64] + os: [linux] + + '@oxlint-tsgolint/win32-arm64@7.0.2003': + resolution: {integrity: sha512-TWauXnPfet0VgpmrstoAK58eJ4gbuwPUuUTQmYQAzE/RG1CpnxXtrKUJULf6lyerPE4KN3gM+DflIA1hOH+38Q==} + cpu: [arm64] + os: [win32] + + '@oxlint-tsgolint/win32-x64@7.0.2003': + resolution: {integrity: sha512-DoRmfe7j8VqNlukp8liRVW45GQDhzRccNenjD/pdzelgtffW47pCMd1xbJLkPaPbKnTwID3onn3VZlL7JbebEA==} + cpu: [x64] + os: [win32] + + '@oxlint/binding-android-arm-eabi@1.87.0': + resolution: {integrity: sha512-22tVIHlB9898OYsBKmYB6He1MCSqdTmK1BVWuSNUTVrpS0KWNege+U9uEYqGJ+KatQag0r/oU44i3OOs46z7HQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.87.0': + resolution: {integrity: sha512-JfZQ3MWf74n8ov0DojZpkOduIubYJvZL5tbTMMhDutsal6u1xH1QuNpN+lK+EQwF8AeAfgwTR2fgh5U2br27XA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.87.0': + resolution: {integrity: sha512-rkx6Xvvw93z2GImVOyvbZwAZcoY0Z6MJW177XNsSB+i/CBsH7ANyelTp01VZyIkM3iSXtqKVb4+ptBgPHap5pQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxlint/binding-darwin-x64@1.87.0': + resolution: {integrity: sha512-cw5nYw7L/pQ2SgGBgOcg/Qo89llQre3vIc/kuBLhSICzu1r5s8L76H3ug6AIFsD98WpROj8/z5JVzkf4daxHaQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxlint/binding-freebsd-x64@1.87.0': + resolution: {integrity: sha512-x/SuznE6loRZK9gz9AS4ZmzNzSu+5KdeoCS+sVHhnrE8HM6AD8UyTjwldQTTqlXGvkwHASgB0NiTNOc3o3PdAg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.87.0': + resolution: {integrity: sha512-+JEDmCAXiiFmKhAjZhgAOwaHWY6WENOQ5QA+lFuY59tgsUCDOTRi46B+lENK6CWvtxsXpwkZXNOgpjAQcpIpnA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.87.0': + resolution: {integrity: sha512-/uC9XqXLAC9AHFLNycwmSQEvKqGrOCgU+uXALI7gNW0DG81TJ/3T2eHnKdRvcb5R1gFEfjxDwI4e4zIa29rICQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.87.0': + resolution: {integrity: sha512-FTRYPsBy/M728vnUv7l+KAwSAa3Qi4BQbhVvy7NYuMTZ0sUa/OWsbMx79HVFw6u/5KWcaYayDsoOiv7xbevzDg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-arm64-musl@1.87.0': + resolution: {integrity: sha512-6sC+N7IY0h1egd8SrYUGNN7CUyKJZ4bIZakKa7V7hfinf4jfi8Kq4+klJvFp5DqXcwMn44I5MeBwmJluO1odFg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-ppc64-gnu@1.87.0': + resolution: {integrity: sha512-d5Mnn+ICbhoJPi37Ccjy+86T5qfH2+mSTrTMBXNPfB+wqSWOayBBLLIrCXdUy1YssluCVdGkl+DO9w5r5ODmUA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-gnu@1.87.0': + resolution: {integrity: sha512-sf5YWuUo1Dx9loqWCgF8P278MycfcD4JHjDC/LV5j11L3Lqa4PFiwCjD6B8kP4AjsgZZkLn3xbpJEtZBaccs4Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-musl@1.87.0': + resolution: {integrity: sha512-+aCraYbmK3uU3P0rFojjeaK9pGY6JvBDXh/0CM+gPyWKmNmXmnFe0qj4qj02U4ibFpbd9Pa9CmDvIdjJUd29rA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-s390x-gnu@1.87.0': + resolution: {integrity: sha512-7rzbZQIljo6VLWVPqUyLa2P/WV3VFsJB4M52R4NCUJn1A50yjtUsHxiMHFL9opEKGFIiTbZ3VQzmtcJOPUq4NQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-gnu@1.87.0': + resolution: {integrity: sha512-Dry46Fa+AXE/xt9J/YriujU1pU9mzfNWHGQwtOYibAFH8HLrKWCi93AhIGnuUMiwn2JbuBkRyz51f50Ly4r4ow==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-musl@1.87.0': + resolution: {integrity: sha512-f/HMZez74gJvnRpGz+b5sdGyWrEgRLmFTXg9sNoqjPWogGxYHUhXKTKyMiYsu9rUGR2ciYqL3fk+Ua4JhMJbRA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxlint/binding-openharmony-arm64@1.87.0': + resolution: {integrity: sha512-lEC6ZfPZm/07JlB7FsOWX9o1RiHlXiBW594LSUGuXmekC8LZmvUPP9XzE2WZcNxJi5cHA/Fw56o02c3JxgMA5g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.87.0': + resolution: {integrity: sha512-afBWKOD36dUiA9AenaiWpCg8xfyUVPYznyAAVXu413brK4RA5UI/Xoc4yfeGIT8G1a44MV+JR7hioryerBDzGQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxlint/binding-win32-ia32-msvc@1.87.0': + resolution: {integrity: sha512-daptNsEOuru4/nJTxV4DBHNJ5GepzmaBVQf+jjgKQGi9NRlZKik+RFq4hUL7ewsF1pwjKM+SkYaMbF82UwFGnw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.87.0': + resolution: {integrity: sha512-k+m/EShyXE29J/r1fjk0HlAzhN5JhIvj044oSJkXTEkCLrWZQgXb/3r4q5LTw/eaKW/4GuMXG2xmiJs3s5rPNw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] '@parcel/watcher-android-arm64@2.5.6': resolution: {integrity: sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==} @@ -8620,14 +8748,6 @@ packages: '@types/yargs@17.0.35': resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} - '@typescript-eslint/eslint-plugin@8.58.1': - resolution: {integrity: sha512-eSkwoemjo76bdXl2MYqtxg51HNwUSkWfODUOQ3PaTLZGh9uIWWFZIjyjaJnex7wXDu+TRx+ATsnSxdN9YWfRTQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - '@typescript-eslint/parser': ^8.58.1 - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/eslint-plugin@8.70.1': resolution: {integrity: sha512-nDNrUQ/4ruSNYbu749TRY7cfrzPtoLHEXSNBI8aaNY32LlZCajixqRf3FqcKC4p5Cam4VOHYx/t+i5+nKXvrqA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -8636,13 +8756,6 @@ packages: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/parser@8.58.1': - resolution: {integrity: sha512-gGkiNMPqerb2cJSVcruigx9eHBlLG14fSdPdqMoOcBfh+vvn4iCq2C8MzUB89PrxOXk0y3GZ1yIWb9aOzL93bw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/parser@8.70.1': resolution: {integrity: sha512-nO974WLllwhSFWQXnMLj6nDGa8f0khKEz1JzpPJ1u7Vm/4X1X6ZHajpoknU4bb41vJyMB0HHVyS2GqdhWfIXZw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -8712,13 +8825,6 @@ packages: peerDependencies: typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/type-utils@8.58.1': - resolution: {integrity: sha512-HUFxvTJVroT+0rXVJC7eD5zol6ID+Sn5npVPWoFuHGg9Ncq5Q4EYstqR+UOqaNRFXi5TYkpXXkLhoCHe3G0+7w==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/type-utils@8.70.1': resolution: {integrity: sha512-7zKTnyvaVWqzLZHPFQtX1hVHqgkMC+WebPWakNCSyrQVbIP1AM0L0TlBZtACldIRb6PptI8Odk+jyZ5kP3B1VA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -9082,22 +9188,6 @@ packages: peerDependencies: vitest: 4.1.11 - '@vitest/eslint-plugin@1.6.27': - resolution: {integrity: sha512-X1RCAfwbatG4GFbJ/1PIHP9MSZMt0JJThqbYID+vS4L783k6QGlLPe421wQE8dHXuGCcenVLsydiM4qzsYWxhg==} - engines: {node: '>=18'} - peerDependencies: - '@typescript-eslint/eslint-plugin': '*' - eslint: '>=8.57.0' - typescript: '>=5.0.0' - vitest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - typescript: - optional: true - vitest: - optional: true - '@vitest/expect@4.1.11': resolution: {integrity: sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==} @@ -9393,133 +9483,157 @@ packages: resolution: {integrity: sha512-Oc2KInVkPfUjEB4PeV6X0NvIoyYTzDe/WmqFrTwBqKs6YKnz4A7XwWQvJTb7M0rLz9a6WgpUUiiS5QKaCi4O/g==} cpu: [arm64] os: [android] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-darwin-arm64@0.10.2': resolution: {integrity: sha512-3H7eNPIHJndUJXZ4QUGBPq1zC6RGcUZfm7bymJes+/N7wTVWUn1bxZ9JcozYHpkWQNm9f23G8YWbaHD9aYH72A==} cpu: [arm64] os: [darwin] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-darwin-x64@0.10.2': resolution: {integrity: sha512-AJOUpR2s3LF9AWiiub/Uyc/UoXNTWcq8hK3cVI6fUSXtwh34dG21J6hRuNlO6JVJFTo4o3ScVvZOrh/YFfUEAA==} cpu: [x64] os: [darwin] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-freebsd-x64@0.10.2': resolution: {integrity: sha512-ms7DcZu87u5CiK/wMwvpKAvAmtaqKjCQIXNweMLypG6qbuiaOMQf1jpbB5+j46xBcgCovo8TQMcv0bCQLKIL9w==} cpu: [x64] os: [freebsd] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm-gnu@0.10.2': resolution: {integrity: sha512-xJDpYAsKV5+eaiBhTYl05fvT6sst4PsCeuIFMRu9b0/WCSrNQPfCDtAQ5/MS6xNpsdujdZEPR+gmfWk3ZG5i3A==} cpu: [arm] os: [linux] libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm-musl@0.10.2': resolution: {integrity: sha512-qfTkgd7AEx61l4K9VtXWCGTxc/fmXJ4ZheDz3i+/AAJUtg4sa0bPrc0VBxPggB/rayR8Z3+JfrBItuyanBJJ9Q==} cpu: [arm] os: [linux] libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm64-gnu@0.10.2': resolution: {integrity: sha512-4e6Mifm/4UdjtU3D8mATIrvgP+xEiH8xtQOjd0zpd72XKWT7ug3sdyhq2utkkZFP6BvYp7SgZrI+aR4VeIOHdw==} cpu: [arm64] os: [linux] libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm64-musl@0.10.2': resolution: {integrity: sha512-RdsJrUfDYFVV3JOmWFUWwSu31fa1APn12xDeIKxgl/YWxrabwtxsDBNjF2561c7tmcbiewdCUvngqRs8AyGVLA==} cpu: [arm64] os: [linux] libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-x64-gnu@0.10.2': resolution: {integrity: sha512-mVzWimEPPreaPyXIUvxsHoJzvO7ckZ5j0LgQFHz04zQIRwt9A9T2hA7K5/jYjJKkMxWG/U2VjhGNwVhtyU+uqg==} cpu: [x64] os: [linux] libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-x64-musl@0.10.2': resolution: {integrity: sha512-Y77fyISurmr2mvO1yeq3u+x/WJbACgPR4w+lzEVx30ViCxZzIGrZPRN1yEdZ9xUNPNsIO5thBHIdRNG+UGUG+Q==} cpu: [x64] os: [linux] libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-win32-arm64@0.10.2': resolution: {integrity: sha512-1+tGLyG0u5YYy0lev4ck7/0sd8xJ9SZde0dLut7qLDPZV5WVTV8x6OxNXUne/PGuHZyO1vK+txPQzzHOyXHGSw==} cpu: [arm64] os: [win32] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-win32-x64@0.10.2': resolution: {integrity: sha512-8a2SExRohRbwC0MY4VpOF0/RSckrJ2ASZqAor5/RYSJJaeadR93n10gZzcKT6pY9ukiSOIZCRKVRD2tH73T0qA==} cpu: [x64] os: [win32] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-parser/binding-android-arm64@0.10.2': resolution: {integrity: sha512-2VPBU9fRGRAQ2xPAvghnec3oou5Nrxm2Bezhf+13UMspAxQSkF/32r+ySKXSwIPA5/RivumDJDxAxc301Sgicw==} cpu: [arm64] os: [android] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-darwin-arm64@0.10.2': resolution: {integrity: sha512-LD+PMZE51tCYTOss5HBkm3/AE39MvcMDBfWJx7A4yDcjfNbAQDnHZKtzSOuqrswx+TQHY0ws5xn6+fWOwtmfBA==} cpu: [arm64] os: [darwin] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-darwin-x64@0.10.2': resolution: {integrity: sha512-mmZ8cND+AoIIMRERyMinlg5ApHxP23B9jH2B5wT7T+dliPa9rubLxneB/SUjFwyUjGaFnB5G7t4YvpfbO5zbkQ==} cpu: [x64] os: [darwin] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-freebsd-x64@0.10.2': resolution: {integrity: sha512-gVIjaaIddbRfAhHlC8N809wQWml7mxfSVnzaLtzGXObTeFTPAg/YVnQXt1UOhPM1ah5eG/8Y0RUlNpB4GVe7eQ==} cpu: [x64] os: [freebsd] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm-gnu@0.10.2': resolution: {integrity: sha512-q/XPPQQAPdlw05aPj30ygBhekmQryGOwxVraBgApjKK8yY1kNQgqq6XCYLF1WHSee+lhxclrTO7W0/bt7dR1GA==} cpu: [arm] os: [linux] libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm-musl@0.10.2': resolution: {integrity: sha512-A+Cb0I1hFF4wilTQpWs79k1aNnj4B2tkrHx3zsuUNF9BtVY2zPZ4yeQEM/zjXrS/qJlNMZVK9NrWJjwdpnTrfg==} cpu: [arm] os: [linux] libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm64-gnu@0.10.2': resolution: {integrity: sha512-aGNSzqIqqphFwAdIFwVvKIyXD1Iy3CxrEJVIZAT87Ecyi4vCmmDD2v2l9h+Gd3/wSy3JZlOI792LJbKAjyy9rQ==} cpu: [arm64] os: [linux] libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm64-musl@0.10.2': resolution: {integrity: sha512-Ddl1sF0rtuCXyHGSOV6dcmdx+ETv1iD+IVFqQuOjzkJZWclxJxdBWX6ZJMRtTiGqGUTbqLEKiTXxpR/Bvqk+2A==} cpu: [arm64] os: [linux] libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-x64-gnu@0.10.2': resolution: {integrity: sha512-/nlcpR6IF5U+0m5L9wvAIXeQa2DT+BXuvqKDsTcOTlcc0B4dHNyqE5hTXsS4hAyimpy2ZK8A1zMNF5hTrjg2cg==} cpu: [x64] os: [linux] libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-x64-musl@0.10.2': resolution: {integrity: sha512-GX80dxTQD/M/OryyuxJcFzFENzry3cDFPvCFTyWogNWQH3fSHfMrNfpwpl1YzMos1eV9NygK5GSDG7VArQlb4w==} cpu: [x64] os: [linux] libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-win32-arm64@0.10.2': resolution: {integrity: sha512-agePQBV4VHewiGU0ACSjscZ/hJd283f9JfAF19Gf1rI5+wy5tTgx4GS36i0b3xim15AQ4RCpDRosEvhLZ4zAOw==} cpu: [arm64] os: [win32] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-win32-x64@0.10.2': resolution: {integrity: sha512-s8//CMpgL5+y1lvDCdyh1rwGI5+ytDJywFJRe1vnhI7n0j+caxshNucurikYLLVeQ2SYFex6aPrzgQxkabBQRA==} cpu: [x64] os: [win32] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-toolchain/types@0.10.2': resolution: {integrity: sha512-sSeo4SSSToiS+sSD+bwn/s94EEcaLJ7tG5LCp8gFYC1G5VzxzX7fqB6m9RU1yMD8KTpu6zdU/I1NlQf8hVBJ9Q==} @@ -11250,8 +11364,8 @@ packages: peerDependencies: eslint: '>=8' - eslint-plugin-import-x@4.16.2: - resolution: {integrity: sha512-rM9K8UBHcWKpzQzStn1YRN2T5NvdeIfSVoKu/lKF41znQXHAUcBbYXe5wd6GNjZjTrP7viQ49n1D83x/2gYgIw==} + eslint-plugin-import-x@4.17.1: + resolution: {integrity: sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/utils': ^8.56.0 @@ -11374,20 +11488,6 @@ packages: svelte: optional: true - eslint-plugin-vue@10.11.1: - resolution: {integrity: sha512-pasVXhl7wUmIvhujoqs/m0mJ9r59QW1IR9XXYKGR0FETzSM+Hhlf4qKIYgWiDDP+9YKv4YfbwskD7LqIdVcgQw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - '@stylistic/eslint-plugin': ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 - '@typescript-eslint/parser': ^7.0.0 || ^8.0.0 - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - vue-eslint-parser: ^10.3.0 - peerDependenciesMeta: - '@stylistic/eslint-plugin': - optional: true - '@typescript-eslint/parser': - optional: true - eslint-scope@4.0.3: resolution: {integrity: sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==} engines: {node: '>=4.0.0'} @@ -14209,6 +14309,23 @@ packages: oxc-resolver@11.24.2: resolution: {integrity: sha512-FY91FiDBj7ls5MsFS9jN3tjz2o0/zsdSsymlakySaBwVJZorHhkWyICLZMKxlu1R9vYo+sd3z1jwb4J8x7bNDw==} + oxlint-tsgolint@7.0.2003: + resolution: {integrity: sha512-VnK4zlqgmgq/7ZcjzCk/WpN8kKFsYGcB85Io9qT3wL4K8Un3RKmJkp793crNETieMusPMKOA4a+Mw2wbteI6TQ==} + hasBin: true + + oxlint@1.87.0: + resolution: {integrity: sha512-drxVlaW7Oqq7wSy1CN25znRu00aRq8n57Q2wniJRxCmtYVz07ufCm7EVDPQFZURrTgQIjzKrVEHAD/HcvJXObg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + oxlint-tsgolint: '>=7.0.2003' + vite-plus: '*' + peerDependenciesMeta: + oxlint-tsgolint: + optional: true + vite-plus: + optional: true + p-finally@1.0.0: resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} engines: {node: '>=4'} @@ -21546,7 +21663,80 @@ snapshots: '@oxc-resolver/binding-win32-x64-msvc@11.24.2': optional: true - '@package-json/types@0.0.12': {} + '@oxlint-tsgolint/darwin-arm64@7.0.2003': + optional: true + + '@oxlint-tsgolint/darwin-x64@7.0.2003': + optional: true + + '@oxlint-tsgolint/linux-arm64@7.0.2003': + optional: true + + '@oxlint-tsgolint/linux-x64@7.0.2003': + optional: true + + '@oxlint-tsgolint/win32-arm64@7.0.2003': + optional: true + + '@oxlint-tsgolint/win32-x64@7.0.2003': + optional: true + + '@oxlint/binding-android-arm-eabi@1.87.0': + optional: true + + '@oxlint/binding-android-arm64@1.87.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.87.0': + optional: true + + '@oxlint/binding-darwin-x64@1.87.0': + optional: true + + '@oxlint/binding-freebsd-x64@1.87.0': + optional: true + + '@oxlint/binding-linux-arm-gnueabihf@1.87.0': + optional: true + + '@oxlint/binding-linux-arm-musleabihf@1.87.0': + optional: true + + '@oxlint/binding-linux-arm64-gnu@1.87.0': + optional: true + + '@oxlint/binding-linux-arm64-musl@1.87.0': + optional: true + + '@oxlint/binding-linux-ppc64-gnu@1.87.0': + optional: true + + '@oxlint/binding-linux-riscv64-gnu@1.87.0': + optional: true + + '@oxlint/binding-linux-riscv64-musl@1.87.0': + optional: true + + '@oxlint/binding-linux-s390x-gnu@1.87.0': + optional: true + + '@oxlint/binding-linux-x64-gnu@1.87.0': + optional: true + + '@oxlint/binding-linux-x64-musl@1.87.0': + optional: true + + '@oxlint/binding-openharmony-arm64@1.87.0': + optional: true + + '@oxlint/binding-win32-arm64-msvc@1.87.0': + optional: true + + '@oxlint/binding-win32-ia32-msvc@1.87.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.87.0': + optional: true '@parcel/watcher-android-arm64@2.5.6': optional: true @@ -22484,17 +22674,6 @@ snapshots: '@standard-schema/spec@1.1.0': {} - '@stylistic/eslint-plugin@5.10.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))': - dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2)) - '@typescript-eslint/types': 8.71.0 - eslint: 9.39.4(jiti@2.7.0)(supports-color@10.2.2) - eslint-visitor-keys: 4.2.1 - espree: 10.4.0 - estraverse: 5.3.0 - picomatch: 4.0.7 - optional: true - '@stylistic/eslint-plugin@5.10.0(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))': dependencies: '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0)) @@ -22658,7 +22837,7 @@ snapshots: '@eslint/js': 10.0.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0)) '@stylistic/eslint-plugin': 5.10.0(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0)) eslint: 9.39.4(jiti@2.7.0)(supports-color@7.2.0) - eslint-plugin-import-x: 4.16.2(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + eslint-plugin-import-x: 4.17.1(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) eslint-plugin-n: 17.24.0(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(typescript@6.0.3) globals: 17.13.0 typescript-eslint: 8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) @@ -22999,23 +23178,6 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.58.1(@typescript-eslint/parser@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': - dependencies: - '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) - '@typescript-eslint/scope-manager': 8.58.1 - '@typescript-eslint/type-utils': 8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) - '@typescript-eslint/utils': 8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) - '@typescript-eslint/visitor-keys': 8.58.1 - eslint: 9.39.4(jiti@2.7.0)(supports-color@7.2.0) - ignore: 7.0.5 - natural-compare: 1.4.0 - ts-api-utils: 2.5.0(typescript@6.0.3) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - optional: true - '@typescript-eslint/eslint-plugin@8.70.1(@typescript-eslint/parser@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3)': dependencies: '@eslint-community/regexpp': 4.12.2 @@ -23048,19 +23210,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3)': - dependencies: - '@typescript-eslint/scope-manager': 8.58.1 - '@typescript-eslint/types': 8.58.1 - '@typescript-eslint/typescript-estree': 8.58.1(supports-color@10.2.2)(typescript@6.0.3) - '@typescript-eslint/visitor-keys': 8.58.1 - debug: 4.4.3(supports-color@10.2.2) - eslint: 9.39.4(jiti@2.7.0)(supports-color@10.2.2) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - optional: true - '@typescript-eslint/parser@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3)': dependencies: '@typescript-eslint/scope-manager': 8.70.1 @@ -23097,16 +23246,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.58.1(supports-color@10.2.2)(typescript@6.0.3)': - dependencies: - '@typescript-eslint/tsconfig-utils': 8.71.0(typescript@6.0.3) - '@typescript-eslint/types': 8.71.0 - debug: 4.4.3(supports-color@10.2.2) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - optional: true - '@typescript-eslint/project-service@8.58.1(supports-color@7.2.0)(typescript@6.0.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.71.0(typescript@6.0.3) @@ -23213,19 +23352,6 @@ snapshots: dependencies: typescript: 6.0.3 - '@typescript-eslint/type-utils@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': - dependencies: - '@typescript-eslint/types': 8.58.1 - '@typescript-eslint/typescript-estree': 8.58.1(supports-color@7.2.0)(typescript@6.0.3) - '@typescript-eslint/utils': 8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) - debug: 4.4.3(supports-color@7.2.0) - eslint: 9.39.4(jiti@2.7.0)(supports-color@7.2.0) - ts-api-utils: 2.5.0(typescript@6.0.3) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - optional: true - '@typescript-eslint/type-utils@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3)': dependencies: '@typescript-eslint/types': 8.70.1 @@ -23257,22 +23383,6 @@ snapshots: '@typescript-eslint/types@8.71.0': {} - '@typescript-eslint/typescript-estree@8.58.1(supports-color@10.2.2)(typescript@6.0.3)': - dependencies: - '@typescript-eslint/project-service': 8.58.1(supports-color@10.2.2)(typescript@6.0.3) - '@typescript-eslint/tsconfig-utils': 8.58.1(typescript@6.0.3) - '@typescript-eslint/types': 8.58.1 - '@typescript-eslint/visitor-keys': 8.58.1 - debug: 4.4.3(supports-color@10.2.2) - minimatch: 10.2.5 - semver: 7.8.5 - tinyglobby: 0.2.17 - ts-api-utils: 2.5.0(typescript@6.0.3) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - optional: true - '@typescript-eslint/typescript-estree@8.58.1(supports-color@7.2.0)(typescript@6.0.3)': dependencies: '@typescript-eslint/project-service': 8.58.1(supports-color@7.2.0)(typescript@6.0.3) @@ -23697,18 +23807,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/eslint-plugin@1.6.27(@typescript-eslint/eslint-plugin@8.58.1(@typescript-eslint/parser@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)(vitest@4.1.11)': - dependencies: - '@typescript-eslint/scope-manager': 8.71.0 - '@typescript-eslint/utils': 8.71.0(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) - eslint: 9.39.4(jiti@2.7.0)(supports-color@7.2.0) - optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.58.1(@typescript-eslint/parser@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) - typescript: 6.0.3 - vitest: 4.1.11(@types/node@22.19.15)(@vitest/coverage-istanbul@4.1.11)(jsdom@27.4.0(supports-color@7.2.0))(msw@2.12.14(@types/node@22.19.15)(typescript@6.0.3))(vite@8.3.1(@types/node@22.19.15)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.90.0)(terser@5.46.1)(tsx@4.21.0)(yaml@2.9.0)) - transitivePeerDependencies: - - supports-color - '@vitest/expect@4.1.11': dependencies: '@standard-schema/spec': 1.1.0 @@ -26346,9 +26444,8 @@ snapshots: eslint: 9.39.4(jiti@2.7.0)(supports-color@7.2.0) eslint-compat-utils: 0.5.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0)) - eslint-plugin-import-x@4.16.2(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-plugin-import-x@4.17.1(@typescript-eslint/utils@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): dependencies: - '@package-json/types': 0.0.12 '@typescript-eslint/types': 8.71.0 comment-parser: 1.4.9 debug: 4.4.3(supports-color@7.2.0) @@ -26670,20 +26767,6 @@ snapshots: transitivePeerDependencies: - ts-node - eslint-plugin-vue@10.11.1(@stylistic/eslint-plugin@5.10.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2)))(@typescript-eslint/parser@8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(vue-eslint-parser@10.4.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)): - dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2)) - eslint: 9.39.4(jiti@2.7.0)(supports-color@10.2.2) - natural-compare: 1.4.0 - nth-check: 2.1.1 - postcss-selector-parser: 7.1.6 - semver: 7.8.5 - vue-eslint-parser: 10.4.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) - xml-name-validator: 5.0.0 - optionalDependencies: - '@stylistic/eslint-plugin': 5.10.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2)) - '@typescript-eslint/parser': 8.58.1(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@6.0.3) - eslint-scope@4.0.3: dependencies: esrecurse: 4.3.0 @@ -30519,6 +30602,38 @@ snapshots: '@oxc-resolver/binding-win32-arm64-msvc': 11.24.2 '@oxc-resolver/binding-win32-x64-msvc': 11.24.2 + oxlint-tsgolint@7.0.2003: + optionalDependencies: + '@oxlint-tsgolint/darwin-arm64': 7.0.2003 + '@oxlint-tsgolint/darwin-x64': 7.0.2003 + '@oxlint-tsgolint/linux-arm64': 7.0.2003 + '@oxlint-tsgolint/linux-x64': 7.0.2003 + '@oxlint-tsgolint/win32-arm64': 7.0.2003 + '@oxlint-tsgolint/win32-x64': 7.0.2003 + + oxlint@1.87.0(oxlint-tsgolint@7.0.2003): + optionalDependencies: + '@oxlint/binding-android-arm-eabi': 1.87.0 + '@oxlint/binding-android-arm64': 1.87.0 + '@oxlint/binding-darwin-arm64': 1.87.0 + '@oxlint/binding-darwin-x64': 1.87.0 + '@oxlint/binding-freebsd-x64': 1.87.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.87.0 + '@oxlint/binding-linux-arm-musleabihf': 1.87.0 + '@oxlint/binding-linux-arm64-gnu': 1.87.0 + '@oxlint/binding-linux-arm64-musl': 1.87.0 + '@oxlint/binding-linux-ppc64-gnu': 1.87.0 + '@oxlint/binding-linux-riscv64-gnu': 1.87.0 + '@oxlint/binding-linux-riscv64-musl': 1.87.0 + '@oxlint/binding-linux-s390x-gnu': 1.87.0 + '@oxlint/binding-linux-x64-gnu': 1.87.0 + '@oxlint/binding-linux-x64-musl': 1.87.0 + '@oxlint/binding-openharmony-arm64': 1.87.0 + '@oxlint/binding-win32-arm64-msvc': 1.87.0 + '@oxlint/binding-win32-ia32-msvc': 1.87.0 + '@oxlint/binding-win32-x64-msvc': 1.87.0 + oxlint-tsgolint: 7.0.2003 + p-finally@1.0.0: {} p-limit@2.3.0: @@ -33907,18 +34022,6 @@ snapshots: optionalDependencies: '@vue/composition-api': 1.7.2(vue@3.5.43(typescript@6.0.3)) - vue-eslint-parser@10.4.0(eslint@9.39.4(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): - dependencies: - debug: 4.4.3(supports-color@10.2.2) - eslint: 9.39.4(jiti@2.7.0)(supports-color@10.2.2) - eslint-scope: 9.1.2 - eslint-visitor-keys: 5.0.1 - espree: 11.2.0 - esquery: 1.7.0 - semver: 7.8.5 - transitivePeerDependencies: - - supports-color - vue-eslint-parser@10.4.0(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): dependencies: debug: 4.4.3(supports-color@7.2.0) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 928c2fdac24..c0d98a1e6e4 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -31,7 +31,6 @@ catalog: # preact '@preact/preset-vite': ^2.10.6 '@testing-library/preact': ^3.2.4 - eslint-config-preact: ^2.0.0 preact: ^10.29.8 # solid @@ -50,7 +49,6 @@ catalog: svelte-check: ^4.4.5 # vue - eslint-plugin-vue: ^10.11.1 unplugin-vue: ^8.0.0 vue: ^3.5.43 diff --git a/scripts/oxlint/plugin.ts b/scripts/oxlint/plugin.ts new file mode 100644 index 00000000000..a7eec5e7fff --- /dev/null +++ b/scripts/oxlint/plugin.ts @@ -0,0 +1,51 @@ +import { builtinRules } from 'eslint/use-at-your-own-risk' +import type { ESLint, Rule } from 'eslint' + +const noRestrictedSyntax = builtinRules.get('no-restricted-syntax') + +if (!noRestrictedSyntax) { + throw new Error('ESLint core rule `no-restricted-syntax` was not found') +} + +const typeParameterPattern = /^(T|T[A-Z][A-Za-z]+)$/ + +/** + * Replaces `@typescript-eslint/naming-convention`, which requires type + * information from the ESLint parser services that Oxlint does not provide. + */ +const typeParameterNaming: Rule.RuleModule = { + meta: { + type: 'suggestion', + docs: { + description: `Require type parameter names to match ${typeParameterPattern}`, + }, + schema: [], + }, + create: (context) => ({ + TSTypeParameter(node: { + name: string | { name: string } + parent: { type: string } + }) { + // Matches `@typescript-eslint/naming-convention`, which skips `infer` declarations + if (node.parent.type === 'TSInferType') return + const name = typeof node.name === 'string' ? node.name : node.name.name + if (!typeParameterPattern.test(name)) { + context.report({ + // @ts-expect-error TSESTree node types are not part of ESLint's node map + node, + message: `Type parameter \`${name}\` must match ${typeParameterPattern}.`, + }) + } + }, + }), +} + +const plugin: ESLint.Plugin = { + meta: { name: 'tanstack-query' }, + rules: { + 'no-restricted-syntax': noRestrictedSyntax, + 'type-parameter-naming': typeParameterNaming, + }, +} + +export default plugin diff --git a/tsconfig.json b/tsconfig.json index a5c1a64e021..0f8c35387f7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "allowSyntheticDefaultImports": true, "allowUnreachableCode": false, "allowUnusedLabels": false, + "allowImportingTsExtensions": true, "checkJs": true, "composite": true, "customConditions": ["@tanstack/custom-condition"], From 3d1796e0a7152e1986a89d36f2562eb13c47647a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Curley?= Date: Thu, 8 Oct 2026 21:31:01 +0100 Subject: [PATCH 2/5] chore: use oxlint disable directives ESLint no longer lints these files, so switch eslint-disable comments to oxlint-disable and the @typescript-eslint/ prefix to typescript/. Remove directives that oxlint reports as unused, and name the rule in the cspell oxlint-enable comments, which oxlint does not match to a rule-specific disable otherwise. Co-Authored-By: Claude Opus 5.5 --- .../infinite-query-options.test-d.ts | 8 +-- .../src/__tests__/query-options.test-d.ts | 2 +- .../src/create-base-query.ts | 2 +- .../src/inject-queries.ts | 2 +- .../stable-query-client.rule.ts | 2 +- .../src/utils/ast-utils.ts | 4 +- .../src/utils/detect-react-query-imports.ts | 2 +- packages/lit-query/src/QueryClientProvider.ts | 4 +- .../createQueriesController.test-d.ts | 1 - .../src/controllers/BaseController.ts | 2 +- .../preact-query/src/HydrationBoundary.tsx | 2 +- .../__tests__/ErrorBoundary/ErrorBoundary.ts | 2 +- .../__tests__/infiniteQueryOptions.test-d.tsx | 8 +-- .../src/__tests__/queryOptions.test-d.tsx | 2 +- .../src/__tests__/useInfiniteQuery.test-d.tsx | 4 +- .../src/__tests__/useMutation.test.tsx | 2 +- .../src/__tests__/useQueries.test-d.tsx | 1 - .../src/__tests__/queryClient.test-d.tsx | 32 ++++----- .../src/__tests__/queryClient.test.tsx | 68 +++++++++---------- .../src/__tests__/retryer.test-d.tsx | 2 +- .../src/__tests__/streamedQuery.test.tsx | 14 ++-- .../query-core/src/__tests__/utils.test-d.tsx | 8 +-- packages/query-core/src/focusManager.ts | 4 +- packages/query-core/src/hydration.ts | 2 +- packages/query-core/src/onlineManager.ts | 2 +- packages/query-core/src/query.ts | 3 +- packages/query-core/src/queryClient.ts | 12 ++-- packages/query-core/src/streamedQuery.ts | 1 - .../src/__tests__/Devtools.test.tsx | 6 +- .../src/__tests__/Explorer.test.tsx | 34 +++++----- .../src/__tests__/utils.test.ts | 12 ++-- .../react-query/src/HydrationBoundary.tsx | 4 +- .../__tests__/infiniteQueryOptions.test-d.tsx | 10 +-- .../src/__tests__/queryOptions.test-d.tsx | 4 +- .../src/__tests__/useInfiniteQuery.test-d.tsx | 4 +- .../src/__tests__/useInfiniteQuery.test.tsx | 2 +- .../src/__tests__/useMutation.test.tsx | 2 +- .../src/__tests__/useQueries.test-d.tsx | 1 - .../src/__tests__/useQuery.test-d.tsx | 2 +- packages/react-query/src/__tests__/utils.tsx | 2 +- .../src/__tests__/queryOptions.test-d.tsx | 2 +- .../src/__tests__/suspense.test.tsx | 4 +- .../src/__tests__/useInfiniteQuery.test-d.tsx | 4 +- .../src/__tests__/useIsMutating.test.tsx | 2 +- .../src/__tests__/useMutation.test.tsx | 2 +- .../src/__tests__/useQueries.test-d.tsx | 1 - .../src/__tests__/useQueries.test.tsx | 2 +- .../src/__tests__/useQuery.test.tsx | 2 +- .../createInfiniteQuery.test-d.ts | 4 +- .../createQueries/createQueries.test-d.ts | 1 - .../tests/infiniteQueryOptions.test-d.ts | 2 +- .../svelte-query/tests/queryOptions.test-d.ts | 2 +- .../src/__tests__/queryClient.test-d.ts | 2 +- .../src/__tests__/queryClient.test.ts | 12 ++-- .../src/__tests__/queryOptions.test-d.ts | 2 +- packages/vue-query/src/queryClient.ts | 10 +-- packages/vue-query/src/utils.ts | 2 +- 57 files changed, 165 insertions(+), 172 deletions(-) diff --git a/packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts b/packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts index a1d22d865cd..8ca4dced2fb 100644 --- a/packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts +++ b/packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts @@ -72,7 +72,7 @@ describe('infiniteQueryOptions', () => { initialPageParam: 1, }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() @@ -225,17 +225,17 @@ describe('infiniteQueryOptions', () => { // deprecated methods below to be removed next major version assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchQuery(options), ) }) diff --git a/packages/angular-query-experimental/src/__tests__/query-options.test-d.ts b/packages/angular-query-experimental/src/__tests__/query-options.test-d.ts index 4f91505ea37..a30783d3f6a 100644 --- a/packages/angular-query-experimental/src/__tests__/query-options.test-d.ts +++ b/packages/angular-query-experimental/src/__tests__/query-options.test-d.ts @@ -89,7 +89,7 @@ it('should work when passed to fetchQuery', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = new QueryClient().fetchQuery(options) assertType>(data) }) diff --git a/packages/angular-query-experimental/src/create-base-query.ts b/packages/angular-query-experimental/src/create-base-query.ts index 62dc2642695..89bb6b692b2 100644 --- a/packages/angular-query-experimental/src/create-base-query.ts +++ b/packages/angular-query-experimental/src/create-base-query.ts @@ -168,7 +168,7 @@ export function createBaseQuery< const originalRefetch = result.refetch return { ...result, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion refetch: ((...args: Parameters) => { observer.setOptions(defaultedOptionsSignal()) return originalRefetch(...args) diff --git a/packages/angular-query-experimental/src/inject-queries.ts b/packages/angular-query-experimental/src/inject-queries.ts index 9eb5ad0851a..1115d82371f 100644 --- a/packages/angular-query-experimental/src/inject-queries.ts +++ b/packages/angular-query-experimental/src/inject-queries.ts @@ -405,7 +405,7 @@ export function injectQueries< ? 'isRestoring' : 'optimistic' - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion return defaultedOptions as QueryObserverOptions }) }) diff --git a/packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts b/packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts index 29c155ec79e..303ce19b8a6 100644 --- a/packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts +++ b/packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts @@ -69,7 +69,7 @@ export const rule = createRule({ } // we need the fallbacks for backwards compat with eslint < 8.37.0 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition const sourceCode = context.sourceCode ?? context.getSourceCode() const nodeText = sourceCode.getText(node) const variableName = parent.id.name diff --git a/packages/eslint-plugin-query/src/utils/ast-utils.ts b/packages/eslint-plugin-query/src/utils/ast-utils.ts index 606e58e2b56..4f3defd1c78 100644 --- a/packages/eslint-plugin-query/src/utils/ast-utils.ts +++ b/packages/eslint-plugin-query/src/utils/ast-utils.ts @@ -194,9 +194,9 @@ export const ASTUtils = { const { node, context } = params // we need the fallbacks for backwards compat with eslint < 8.37.0 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition const sourceCode = context.sourceCode ?? context.getSourceCode() - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition const scope = context.sourceCode.getScope(node) ? sourceCode.getScope(node) : context.getScope() diff --git a/packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts b/packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts index 911aa6f9953..abf9d2b6817 100644 --- a/packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts +++ b/packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts @@ -61,7 +61,7 @@ export function detectTanstackQueryImports(create: EnhancedCreate): Create { ImportDeclaration(node) { if ( node.specifiers.length > 0 && - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition (node.importKind === 'value' || node.importKind === undefined) && node.source.value.startsWith('@tanstack/') && node.source.value.endsWith('-query') diff --git a/packages/lit-query/src/QueryClientProvider.ts b/packages/lit-query/src/QueryClientProvider.ts index 77ec7611b11..c197e3a8b66 100644 --- a/packages/lit-query/src/QueryClientProvider.ts +++ b/packages/lit-query/src/QueryClientProvider.ts @@ -120,7 +120,7 @@ export class QueryClientProvider extends LitElement { } const nextClient = this.client - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition if (!nextClient) { if (this.isConnected) { this.unmountClient(this.mountedClient) @@ -182,7 +182,7 @@ export class QueryClientProvider extends LitElement { } private requireClient(): QueryClient { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition if (!this.client) { throw createMissingQueryClientError() } diff --git a/packages/lit-query/src/__tests__/createQueriesController.test-d.ts b/packages/lit-query/src/__tests__/createQueriesController.test-d.ts index 1f72fcb9f7c..5556941ed62 100644 --- a/packages/lit-query/src/__tests__/createQueriesController.test-d.ts +++ b/packages/lit-query/src/__tests__/createQueriesController.test-d.ts @@ -976,7 +976,6 @@ describe('createQueriesController', () => { queryFn: fn && fn !== skipToken ? (ctx: QueryFunctionContext) => { - // eslint-disable-next-line vitest/valid-expect expectTypeOf(ctx.queryKey) return fn.call({}, ctx) } diff --git a/packages/lit-query/src/controllers/BaseController.ts b/packages/lit-query/src/controllers/BaseController.ts index 8f666c0fe14..ecaa09b0ea0 100644 --- a/packages/lit-query/src/controllers/BaseController.ts +++ b/packages/lit-query/src/controllers/BaseController.ts @@ -281,7 +281,7 @@ export abstract class BaseController implements ReactiveController { } const resolutionChanged = this.updateQueryClientResolutionState( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition value === undefined ? 'missing' : 'bound', ) const clientChanged = this.contextClient !== value diff --git a/packages/preact-query/src/HydrationBoundary.tsx b/packages/preact-query/src/HydrationBoundary.tsx index 0cb947d1990..893774a266f 100644 --- a/packages/preact-query/src/HydrationBoundary.tsx +++ b/packages/preact-query/src/HydrationBoundary.tsx @@ -121,7 +121,7 @@ export const HydrationBoundary = ({ // State is supplied from the outside and we might as well fail // gracefully if it has the wrong shape, so while we type `queries` // as required, we still provide a fallback. - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition const queries = state.queries || [] const newQueries: DehydratedState['queries'] = [] diff --git a/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundary.ts b/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundary.ts index 457eb8ae781..2d8de273543 100644 --- a/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundary.ts +++ b/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundary.ts @@ -80,7 +80,7 @@ export class ErrorBoundary extends Component< reason: 'keys', }) - // eslint-disable-next-line + // oxlint-disable-next-line this.setState(initialState) } } diff --git a/packages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsx b/packages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsx index 6c3147241e5..e591cc010b2 100644 --- a/packages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsx +++ b/packages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsx @@ -131,7 +131,7 @@ describe('infiniteQueryOptions', () => { initialPageParam: 1, }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() @@ -235,17 +235,17 @@ describe('infiniteQueryOptions', () => { // deprecated methods below to be removed next major version assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchQuery(options), ) }) diff --git a/packages/preact-query/src/__tests__/queryOptions.test-d.tsx b/packages/preact-query/src/__tests__/queryOptions.test-d.tsx index 8d7f5e62676..fb4c57b2d96 100644 --- a/packages/preact-query/src/__tests__/queryOptions.test-d.tsx +++ b/packages/preact-query/src/__tests__/queryOptions.test-d.tsx @@ -100,7 +100,7 @@ describe('queryOptions', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) diff --git a/packages/preact-query/src/__tests__/useInfiniteQuery.test-d.tsx b/packages/preact-query/src/__tests__/useInfiniteQuery.test-d.tsx index a20b8427751..c2c7784544c 100644 --- a/packages/preact-query/src/__tests__/useInfiniteQuery.test-d.tsx +++ b/packages/preact-query/src/__tests__/useInfiniteQuery.test-d.tsx @@ -31,7 +31,7 @@ describe('pageParam', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for fetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { @@ -55,7 +55,7 @@ describe('pageParam', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for prefetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { diff --git a/packages/preact-query/src/__tests__/useMutation.test.tsx b/packages/preact-query/src/__tests__/useMutation.test.tsx index f17d5101292..17639bbe04f 100644 --- a/packages/preact-query/src/__tests__/useMutation.test.tsx +++ b/packages/preact-query/src/__tests__/useMutation.test.tsx @@ -1268,7 +1268,7 @@ describe('useMutation', () => { onlineMock.mockRestore() }) - // eslint-disable-next-line vitest/expect-expect + // oxlint-disable-next-line vitest/expect-expect it('should not change state if unmounted', () => { function Mutates() { const { mutate } = useMutation({ mutationFn: () => sleep(10) }) diff --git a/packages/preact-query/src/__tests__/useQueries.test-d.tsx b/packages/preact-query/src/__tests__/useQueries.test-d.tsx index 1fc56d04172..ca8cbaf369e 100644 --- a/packages/preact-query/src/__tests__/useQueries.test-d.tsx +++ b/packages/preact-query/src/__tests__/useQueries.test-d.tsx @@ -806,7 +806,6 @@ describe('useQueries', () => { queryFn: fn && fn !== skipToken ? (ctx: QueryFunctionContext) => { - // eslint-disable-next-line vitest/valid-expect expectTypeOf(ctx.queryKey) return fn.call({}, ctx) } diff --git a/packages/query-core/src/__tests__/queryClient.test-d.tsx b/packages/query-core/src/__tests__/queryClient.test-d.tsx index 12e5313d5f5..08a78fc8a3d 100644 --- a/packages/query-core/src/__tests__/queryClient.test-d.tsx +++ b/packages/query-core/src/__tests__/queryClient.test-d.tsx @@ -74,12 +74,12 @@ const typedFilterKey = typedQueryFilters.queryKey! const typedMutationKey = typedMutationOptions.mutationKey! const untypedQueryOptions: EnsureQueryDataOptions = { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion queryKey: ['key'] as any, } const untypedFetchInfiniteQueryOptions: FetchInfiniteQueryOptions = { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion queryKey: ['key'] as any, pages: 5, getNextPageParam: (lastPage) => { @@ -386,7 +386,7 @@ describe('queryClient', () => { it('should resolve with the data type', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.fetchQuery(typedQueryOptions) expectTypeOf(data).toEqualTypeOf() @@ -394,7 +394,7 @@ describe('queryClient', () => { it('should resolve with unknown when untyped', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.fetchQuery(untypedQueryOptions) expectTypeOf(data).toEqualTypeOf() @@ -419,7 +419,7 @@ describe('queryClient', () => { }) it('should allow passing pages', async () => { - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery({ queryKey: queryKey(), queryFn: () => Promise.resolve('string'), @@ -456,7 +456,7 @@ describe('queryClient', () => { it('should resolve with InfiniteData of the data type', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.fetchInfiniteQuery( typedFetchInfiniteQueryOptions, ) @@ -466,7 +466,7 @@ describe('queryClient', () => { it('should resolve with InfiniteData of unknown when untyped', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.fetchInfiniteQuery( untypedFetchInfiniteQueryOptions, ) @@ -525,7 +525,7 @@ describe('queryClient', () => { describe('ensureQueryData', () => { it('should resolve with the data type', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.ensureQueryData(typedQueryOptions) expectTypeOf(data).toEqualTypeOf() @@ -533,7 +533,7 @@ describe('queryClient', () => { it('should resolve with unknown when untyped', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.ensureQueryData(untypedQueryOptions) expectTypeOf(data).toEqualTypeOf() @@ -549,7 +549,7 @@ describe('queryClient', () => { getNextPageParam: () => 2, select: (data) => ({ pages: data.pages.map( - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion (x) => `count: ${(x as { count: number }).count}`, ), }), @@ -649,7 +649,7 @@ describe('queryClient', () => { describe('ensureInfiniteQueryData', () => { it('should resolve with InfiniteData of the data type', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.ensureInfiniteQueryData( typedFetchInfiniteQueryOptions, ) @@ -659,7 +659,7 @@ describe('queryClient', () => { it('should resolve with InfiniteData of unknown when untyped', async () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await queryClient.ensureInfiniteQueryData( untypedFetchInfiniteQueryOptions, ) @@ -670,7 +670,7 @@ describe('queryClient', () => { it('should accept a revalidateIfStale that FetchInfiniteQueryOptions does not have', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ ...typedFetchInfiniteQueryOptions, revalidateIfStale: true, @@ -942,7 +942,7 @@ describe('queryClient', () => { describe('prefetchQuery', () => { it('should return a promise of void rather than the data', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const result = queryClient.prefetchQuery({ queryKey: ['key'], queryFn: () => Promise.resolve('string'), @@ -955,7 +955,7 @@ describe('queryClient', () => { describe('prefetchInfiniteQuery', () => { it('should return a promise of void rather than the pages', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const result = queryClient.prefetchInfiniteQuery({ queryKey: ['key'], queryFn: () => Promise.resolve('string'), @@ -1163,7 +1163,7 @@ describe('queryClient', () => { ).toEqualTypeOf() }) - // eslint-disable-next-line vitest/expect-expect -- Oxlint does not find assertions inside object methods + // oxlint-disable-next-line vitest/expect-expect -- Oxlint does not find assertions inside object methods it('should type the onSettled callback arguments', () => { const queryClient = new QueryClient() diff --git a/packages/query-core/src/__tests__/queryClient.test.tsx b/packages/query-core/src/__tests__/queryClient.test.tsx index 135ee29a35c..fa6057fe2be 100644 --- a/packages/query-core/src/__tests__/queryClient.test.tsx +++ b/packages/query-core/src/__tests__/queryClient.test.tsx @@ -478,7 +478,7 @@ describe('queryClient', () => { queryClient.setQueryData([key, 'id'], 'bar') await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn }), ).resolves.toEqual('bar') }) @@ -489,7 +489,7 @@ describe('queryClient', () => { queryClient.setQueryData([key, 'id'], null) await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn }), ).resolves.toEqual(null) }) @@ -499,7 +499,7 @@ describe('queryClient', () => { const queryFn = () => Promise.resolve('data') await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key], queryFn }), ).resolves.toEqual('data') }) @@ -515,7 +515,7 @@ describe('queryClient', () => { }) await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn, @@ -524,7 +524,7 @@ describe('queryClient', () => { ).resolves.toEqual('old') await vi.advanceTimersByTimeAsync(TIMEOUT + 10) await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn, @@ -538,7 +538,7 @@ describe('queryClient', () => { const queryFn = vi.fn().mockImplementation(() => Promise.resolve('data')) await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: [key, 'id'], queryFn, @@ -647,7 +647,7 @@ describe('queryClient', () => { queryClient.setQueryData([key, 'id'], { pages: ['bar'], pageParams: [0] }) await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ queryKey: [key, 'id'], queryFn, @@ -662,7 +662,7 @@ describe('queryClient', () => { const queryFn = () => Promise.resolve('data') await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ queryKey: [key, 'id'], queryFn, @@ -680,7 +680,7 @@ describe('queryClient', () => { const queryFn = () => sleep(TIMEOUT).then(() => 'new') await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ queryKey: [key, 'id'], queryFn, @@ -691,7 +691,7 @@ describe('queryClient', () => { ).resolves.toEqual({ pages: ['old'], pageParams: [0] }) await vi.advanceTimersByTimeAsync(TIMEOUT + 10) await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureInfiniteQueryData({ queryKey: [key, 'id'], queryFn, @@ -783,7 +783,7 @@ describe('queryClient', () => { Promise.resolve('data') await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -796,7 +796,7 @@ describe('queryClient', () => { const key = queryKey() await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery({ queryKey: key, queryFn: (): Promise => { @@ -810,13 +810,13 @@ describe('queryClient', () => { const key = queryKey() const fetchFn = () => Promise.resolve('data') - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const first = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const second = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -829,7 +829,7 @@ describe('queryClient', () => { const fetchFn = vi.fn(() => Promise.resolve({ data: 'data' })) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const first = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -843,7 +843,7 @@ describe('queryClient', () => { refetchType: 'none', }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const second = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -856,7 +856,7 @@ describe('queryClient', () => { it('should be able to fetch when garbage collection time is set to 0 and then be removed', async () => { const key1 = queryKey() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const promise = queryClient.fetchQuery({ queryKey: key1, queryFn: () => sleep(10).then(() => 1), @@ -870,7 +870,7 @@ describe('queryClient', () => { it('should keep a query in cache if garbage collection time is Infinity', async () => { const key1 = queryKey() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const promise = queryClient.fetchQuery({ queryKey: key1, queryFn: () => sleep(10).then(() => 1), @@ -886,7 +886,7 @@ describe('queryClient', () => { const key = queryKey() queryClient.setQueryData(key, 'og') const fetchFn = () => Promise.resolve('new') - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const first = await queryClient.fetchQuery({ queryKey: key, queryFn: fetchFn, @@ -903,7 +903,7 @@ describe('queryClient', () => { const queryFn = () => ++count queryClient.setQueryData(key, count) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const firstPromise = queryClient.fetchQuery({ queryKey: key, queryFn, @@ -911,14 +911,14 @@ describe('queryClient', () => { }) await expect(firstPromise).resolves.toBe(0) await vi.advanceTimersByTimeAsync(10) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const secondPromise = queryClient.fetchQuery({ queryKey: key, queryFn, staleTime: 10, }) await expect(secondPromise).resolves.toBe(1) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const thirdPromise = queryClient.fetchQuery({ queryKey: key, queryFn, @@ -926,7 +926,7 @@ describe('queryClient', () => { }) await expect(thirdPromise).resolves.toBe(1) await vi.advanceTimersByTimeAsync(10) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const fourthPromise = queryClient.fetchQuery({ queryKey: key, queryFn, @@ -938,7 +938,7 @@ describe('queryClient', () => { it('should allow new meta', async () => { const key = queryKey() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const first = await queryClient.fetchQuery({ queryKey: key, queryFn: ({ meta }) => Promise.resolve(meta), @@ -948,7 +948,7 @@ describe('queryClient', () => { }) expect(first).toStrictEqual({ foo: true }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const second = await queryClient.fetchQuery({ queryKey: key, queryFn: ({ meta }) => Promise.resolve(meta), @@ -1389,7 +1389,7 @@ describe('queryClient', () => { Promise.resolve(data.pages[0]) await expect( - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery< StrictData, any, @@ -1402,7 +1402,7 @@ describe('queryClient', () => { it('should return infinite query data', async () => { const key = queryKey() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const result = await queryClient.fetchInfiniteQuery({ queryKey: key, initialPageParam: 10, @@ -1650,7 +1650,7 @@ describe('queryClient', () => { const fetchFn: QueryFunction = () => Promise.resolve('data') - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchInfiniteQuery< StrictData, any, @@ -1670,7 +1670,7 @@ describe('queryClient', () => { it('should return infinite query data', async () => { const key = queryKey() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchInfiniteQuery({ queryKey: key, queryFn: ({ pageParam }) => Number(pageParam), @@ -1688,7 +1688,7 @@ describe('queryClient', () => { it('should prefetch multiple pages', async () => { const key = queryKey() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchInfiniteQuery({ queryKey: key, queryFn: ({ pageParam }) => String(pageParam), @@ -1710,7 +1710,7 @@ describe('queryClient', () => { const key = queryKey() let count = 0 - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchInfiniteQuery({ queryKey: key, queryFn: ({ pageParam }) => String(pageParam), @@ -1839,7 +1839,7 @@ describe('queryClient', () => { const fetchFn: QueryFunction = () => Promise.resolve('data') - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchQuery< StrictData, any, @@ -1855,7 +1855,7 @@ describe('queryClient', () => { it('should return undefined when an error is thrown', async () => { const key = queryKey() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const result = await queryClient.prefetchQuery({ queryKey: key, queryFn: (): Promise => { @@ -1869,7 +1869,7 @@ describe('queryClient', () => { it('should be garbage collected after gcTime if unused', async () => { const key = queryKey() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test await queryClient.prefetchQuery({ queryKey: key, queryFn: () => 'data', diff --git a/packages/query-core/src/__tests__/retryer.test-d.tsx b/packages/query-core/src/__tests__/retryer.test-d.tsx index fdee9459d53..41d079d81b6 100644 --- a/packages/query-core/src/__tests__/retryer.test-d.tsx +++ b/packages/query-core/src/__tests__/retryer.test-d.tsx @@ -37,7 +37,7 @@ describe('retryer', () => { it('should default TData to unknown', () => { expectTypeOf( createRetryer({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion fn: () => ({}) as unknown, networkMode: undefined, canRun: () => true, diff --git a/packages/query-core/src/__tests__/streamedQuery.test.tsx b/packages/query-core/src/__tests__/streamedQuery.test.tsx index 642218fd0fa..45626e83ce1 100644 --- a/packages/query-core/src/__tests__/streamedQuery.test.tsx +++ b/packages/query-core/src/__tests__/streamedQuery.test.tsx @@ -287,7 +287,7 @@ describe('streamedQuery', () => { queryFn: streamedQuery({ streamFn: (context) => { // just consume the signal - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition const numbers = context.signal ? 3 : 0 return createAsyncNumberGenerator(numbers) }, @@ -338,7 +338,7 @@ describe('streamedQuery', () => { queryFn: streamedQuery({ streamFn: (context) => { // just consume the signal - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition const numbers = context.signal ? 3 : 0 return createAsyncNumberGenerator(numbers) }, @@ -409,7 +409,7 @@ describe('streamedQuery', () => { ...acc, [chunk]: true, }), - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion initialValue: {} as Record, }), }) @@ -443,7 +443,7 @@ describe('streamedQuery', () => { ...acc, [chunk]: true, }), - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion initialValue: { 10: true, 11: true, @@ -479,7 +479,7 @@ describe('streamedQuery', () => { queryFn: streamedQuery({ initialValue: 'initial', reducer: () => null, - // eslint-disable-next-line @typescript-eslint/require-await + // oxlint-disable-next-line typescript/require-await streamFn: async function* () { yield 1 }, @@ -500,7 +500,7 @@ describe('streamedQuery', () => { retry: false, queryFn: streamedQuery({ refetchMode: 'reset', - // eslint-disable-next-line @typescript-eslint/require-await + // oxlint-disable-next-line typescript/require-await streamFn: async function* () { if (shouldError) { throw error @@ -647,7 +647,7 @@ describe('streamedQuery', () => { const observer = new QueryObserver(queryClient, { queryKey: key, queryFn: streamedQuery({ - // eslint-disable-next-line @typescript-eslint/require-await + // oxlint-disable-next-line typescript/require-await streamFn: async function* () { const v = [1, 2, 3] yield* v diff --git a/packages/query-core/src/__tests__/utils.test-d.tsx b/packages/query-core/src/__tests__/utils.test-d.tsx index a633009d63e..06dfc10785c 100644 --- a/packages/query-core/src/__tests__/utils.test-d.tsx +++ b/packages/query-core/src/__tests__/utils.test-d.tsx @@ -118,7 +118,7 @@ describe('QueryFilters', () => { }) // we test that there are not type errors here - // eslint-disable-next-line vitest/expect-expect + // oxlint-disable-next-line vitest/expect-expect it('should work with unions of different lengths', () => { type Key = | readonly ['foo'] @@ -630,7 +630,7 @@ describe('matchMutation', () => { describe('replaceEqualDeep', () => { it('should return the type of b and not relate it to a', () => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion const result = replaceEqualDeep({ a: 1 } as unknown, { b: '1' }) expectTypeOf(result).toEqualTypeOf<{ b: string }>() @@ -643,9 +643,9 @@ describe('replaceEqualDeep', () => { }) it('should accept the depth argument optionally', () => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion expectTypeOf(replaceEqualDeep(1 as unknown, 2)).toEqualTypeOf() - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion expectTypeOf(replaceEqualDeep(1 as unknown, 2, 0)).toEqualTypeOf() }) }) diff --git a/packages/query-core/src/focusManager.ts b/packages/query-core/src/focusManager.ts index a4c65b99742..0dd0c9e8d1a 100644 --- a/packages/query-core/src/focusManager.ts +++ b/packages/query-core/src/focusManager.ts @@ -21,7 +21,7 @@ export class FocusManager extends Subscribable { super() this.#setup = (onFocus) => { // addEventListener does not exist in React Native, but window does - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition if (typeof window !== 'undefined' && window.addEventListener) { const listener = () => onFocus() // Listen to visibilitychange @@ -133,7 +133,7 @@ export class FocusManager extends Subscribable { } // document global can be unavailable in react native - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition return globalThis.document?.visibilityState !== 'hidden' } } diff --git a/packages/query-core/src/hydration.ts b/packages/query-core/src/hydration.ts index 88f70635231..6f763d645ae 100644 --- a/packages/query-core/src/hydration.ts +++ b/packages/query-core/src/hydration.ts @@ -32,7 +32,7 @@ function tryResolveSync(promise: PromiseLike) { }, noop) as Promise | undefined // .catch can be unavailable on certain kinds of thenable's - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition thenResult?.catch?.(noop) if (data !== undefined) { diff --git a/packages/query-core/src/onlineManager.ts b/packages/query-core/src/onlineManager.ts index c232e1c3e4d..f6704ede01a 100644 --- a/packages/query-core/src/onlineManager.ts +++ b/packages/query-core/src/onlineManager.ts @@ -22,7 +22,7 @@ export class OnlineManager extends Subscribable { super() this.#setup = (onOnline) => { // addEventListener does not exist in React Native, but window does - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition if (typeof window !== 'undefined' && window.addEventListener) { const onlineListener = () => onOnline(true) const offlineListener = () => onOnline(false) diff --git a/packages/query-core/src/query.ts b/packages/query-core/src/query.ts index a277e86a27d..56393b6a763 100644 --- a/packages/query-core/src/query.ts +++ b/packages/query-core/src/query.ts @@ -359,7 +359,7 @@ export class Query< this.updateGcTime(this.options.gcTime) - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition if (this.state && this.state.data === undefined) { const defaultState = getDefaultState(this.options) if (defaultState.data !== undefined) { @@ -867,7 +867,6 @@ export class Query< try { const data = await retryer.start() // this is more of a runtime guard - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (data === undefined) { if (process.env.NODE_ENV !== 'production') { console.error( diff --git a/packages/query-core/src/queryClient.ts b/packages/query-core/src/queryClient.ts index 6d75176e11d..b2b7e70f57b 100644 --- a/packages/query-core/src/queryClient.ts +++ b/packages/query-core/src/queryClient.ts @@ -217,7 +217,7 @@ export class QueryClient { const cachedData = query.state.data if (cachedData === undefined) { - // eslint-disable-next-line tanstack-query/no-restricted-syntax + // oxlint-disable-next-line tanstack-query/no-restricted-syntax return this.fetchQuery(options) } @@ -225,7 +225,7 @@ export class QueryClient { options.revalidateIfStale && query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ) { - // eslint-disable-next-line tanstack-query/no-restricted-syntax + // oxlint-disable-next-line tanstack-query/no-restricted-syntax void this.prefetchQuery(defaultedOptions) } @@ -691,7 +691,7 @@ export class QueryClient { >( options: FetchQueryOptions, ): Promise { - // eslint-disable-next-line tanstack-query/no-restricted-syntax + // oxlint-disable-next-line tanstack-query/no-restricted-syntax return this.fetchQuery(options).then(noop).catch(noop) } @@ -766,7 +766,7 @@ export class QueryClient { >, ): Promise> { options._type = 'infinite' - // eslint-disable-next-line tanstack-query/no-restricted-syntax + // oxlint-disable-next-line tanstack-query/no-restricted-syntax return this.fetchQuery(options as any) } @@ -793,7 +793,7 @@ export class QueryClient { TPageParam >, ): Promise { - // eslint-disable-next-line tanstack-query/no-restricted-syntax + // oxlint-disable-next-line tanstack-query/no-restricted-syntax return this.fetchInfiniteQuery(options).then(noop).catch(noop) } @@ -823,7 +823,7 @@ export class QueryClient { ): Promise> { options._type = 'infinite' - // eslint-disable-next-line tanstack-query/no-restricted-syntax + // oxlint-disable-next-line tanstack-query/no-restricted-syntax return this.ensureQueryData(options as any) } diff --git a/packages/query-core/src/streamedQuery.ts b/packages/query-core/src/streamedQuery.ts index 695d6d08116..4a2c59b948c 100644 --- a/packages/query-core/src/streamedQuery.ts +++ b/packages/query-core/src/streamedQuery.ts @@ -95,7 +95,6 @@ export function streamedQuery< let result = initialValue - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion let cancelled = false as boolean const streamFnContext = addConsumeAwareSignal< OmitKeyof diff --git a/packages/query-devtools/src/__tests__/Devtools.test.tsx b/packages/query-devtools/src/__tests__/Devtools.test.tsx index 24d4f81a815..2569772fed0 100644 --- a/packages/query-devtools/src/__tests__/Devtools.test.tsx +++ b/packages/query-devtools/src/__tests__/Devtools.test.tsx @@ -94,7 +94,7 @@ describe('Devtools', () => { contentRect: { width: 1000, height: 500 } as DOMRectReadOnly, } as ResizeObserverEntry, ], - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion this as unknown as ResizeObserver, ) }) @@ -808,7 +808,7 @@ describe('Devtools', () => { contentRect: { width: 500, height: 500 } as DOMRectReadOnly, } as ResizeObserverEntry, ], - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion this as unknown as ResizeObserver, ) }) @@ -845,7 +845,7 @@ describe('Devtools', () => { contentRect: { width: 500, height: 500 } as DOMRectReadOnly, } as ResizeObserverEntry, ], - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion this as unknown as ResizeObserver, ) }) diff --git a/packages/query-devtools/src/__tests__/Explorer.test.tsx b/packages/query-devtools/src/__tests__/Explorer.test.tsx index ecb4e46a2cf..d462063bc0f 100644 --- a/packages/query-devtools/src/__tests__/Explorer.test.tsx +++ b/packages/query-devtools/src/__tests__/Explorer.test.tsx @@ -189,7 +189,7 @@ describe('Explorer', () => { label: 'data', value: { name: 'Anna' }, editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -215,7 +215,7 @@ describe('Explorer', () => { label: 'data', value: { name: 'Anna' }, editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -241,7 +241,7 @@ describe('Explorer', () => { label: 'data', value: { name: 'Anna' }, editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -268,7 +268,7 @@ describe('Explorer', () => { label: 'data', value: { name: 'Anna' }, editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -292,7 +292,7 @@ describe('Explorer', () => { label: 'list', value: ['a', 'b', 'c'], editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -310,7 +310,7 @@ describe('Explorer', () => { value: ['a', 'b', 'c'], editable: true, itemsDeletable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -328,7 +328,7 @@ describe('Explorer', () => { label: 'flag', value: true, editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -346,7 +346,7 @@ describe('Explorer', () => { label: 'list', value: ['a'], editable: false, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -363,7 +363,7 @@ describe('Explorer', () => { label: 'user', value: { name: 'Anna' }, editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -439,7 +439,7 @@ describe('Explorer', () => { value, defaultExpanded: ['Data'], editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -460,7 +460,7 @@ describe('Explorer', () => { label: 'name', value: 'Anna', editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -481,7 +481,7 @@ describe('Explorer', () => { label: 'count', value: 1, editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -504,7 +504,7 @@ describe('Explorer', () => { label: 'flag', value: false, editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -522,7 +522,7 @@ describe('Explorer', () => { value: 'Anna', editable: true, itemsDeletable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -541,7 +541,7 @@ describe('Explorer', () => { value, defaultExpanded: ['Data'], editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -569,7 +569,7 @@ describe('Explorer', () => { value, defaultExpanded: ['Data'], editable: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion activeQuery: queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query, @@ -607,7 +607,7 @@ describe('Explorer', () => { defaultExpanded={['Data']} editable={true} activeQuery={ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + // oxlint-disable-next-line typescript/no-unnecessary-type-assertion queryClient .getQueryCache() .find({ queryKey: ['data'] }) as Query diff --git a/packages/query-devtools/src/__tests__/utils.test.ts b/packages/query-devtools/src/__tests__/utils.test.ts index f51167ff3c9..6c7b74fc069 100644 --- a/packages/query-devtools/src/__tests__/utils.test.ts +++ b/packages/query-devtools/src/__tests__/utils.test.ts @@ -111,7 +111,7 @@ describe('Utils tests', () => { ['fr', 'bonjour'], ]) - /* eslint-disable cspell/spellchecker */ + /* oxlint-disable cspell/spellchecker */ const newData = updateNestedDataByPath(oldData, ['fr'], 'salut') expect(newData).not.toBe(oldData) // should not be the same reference @@ -128,7 +128,7 @@ describe('Utils tests', () => { } `) }) - /* eslint-enable */ + /* oxlint-enable cspell/spellchecker */ }) describe('empty path', () => { @@ -177,7 +177,7 @@ describe('Utils tests', () => { describe('nested data', () => { it('should update data correctly', () => { - /* eslint-disable cspell/spellchecker */ + /* oxlint-disable cspell/spellchecker */ const oldData = new Map([ [ 'pumpkin-pie', @@ -433,7 +433,7 @@ describe('Utils tests', () => { }, } `) - /* eslint-enable */ + /* oxlint-enable cspell/spellchecker */ }) }) }) @@ -562,7 +562,7 @@ describe('Utils tests', () => { describe('nested data', () => { it('should delete nested items correctly', () => { - /* eslint-disable cspell/spellchecker */ + /* oxlint-disable cspell/spellchecker */ const oldData = new Map([ [ 'pumpkin-pie', @@ -813,7 +813,7 @@ describe('Utils tests', () => { }, } `) - /* eslint-enable */ + /* oxlint-enable cspell/spellchecker */ }) }) }) diff --git a/packages/react-query/src/HydrationBoundary.tsx b/packages/react-query/src/HydrationBoundary.tsx index 4dee1bfbdd0..47c8a3249f3 100644 --- a/packages/react-query/src/HydrationBoundary.tsx +++ b/packages/react-query/src/HydrationBoundary.tsx @@ -121,7 +121,7 @@ export const HydrationBoundary = ({ // State is supplied from the outside and we might as well fail // gracefully if it has the wrong shape, so while we type `queries` // as required, we still provide a fallback. - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition const queries = state.queries || [] const newQueries: DehydratedState['queries'] = [] @@ -150,7 +150,7 @@ export const HydrationBoundary = ({ if (newQueries.length > 0) { // It's actually fine to call this with queries/state that already exists // in the cache, or is older. hydrate() is idempotent for queries. - // eslint-disable-next-line react-hooks-js/refs + // oxlint-disable-next-line react-hooks-js/refs hydrate(client, { queries: newQueries }, optionsRef.current) } if (existingQueries.length > 0) { diff --git a/packages/react-query/src/__tests__/infiniteQueryOptions.test-d.tsx b/packages/react-query/src/__tests__/infiniteQueryOptions.test-d.tsx index 43ff00e3543..6db0c737bfe 100644 --- a/packages/react-query/src/__tests__/infiniteQueryOptions.test-d.tsx +++ b/packages/react-query/src/__tests__/infiniteQueryOptions.test-d.tsx @@ -157,7 +157,7 @@ describe('infiniteQueryOptions', () => { initialPageParam: 1, }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() @@ -171,7 +171,7 @@ describe('infiniteQueryOptions', () => { select: (data) => data.pages, }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() @@ -275,17 +275,17 @@ describe('infiniteQueryOptions', () => { // deprecated methods to be removed in v6 assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery(options), ) assertType( // @ts-expect-error cannot pass infinite options to non-infinite query functions - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchQuery(options), ) }) diff --git a/packages/react-query/src/__tests__/queryOptions.test-d.tsx b/packages/react-query/src/__tests__/queryOptions.test-d.tsx index 68285671b24..26d9775fd30 100644 --- a/packages/react-query/src/__tests__/queryOptions.test-d.tsx +++ b/packages/react-query/src/__tests__/queryOptions.test-d.tsx @@ -74,7 +74,7 @@ describe('queryOptions', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) @@ -114,7 +114,7 @@ describe('queryOptions', () => { select: (data) => data.toString(), }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) diff --git a/packages/react-query/src/__tests__/useInfiniteQuery.test-d.tsx b/packages/react-query/src/__tests__/useInfiniteQuery.test-d.tsx index 126ce6ac582..52bdebff9f0 100644 --- a/packages/react-query/src/__tests__/useInfiniteQuery.test-d.tsx +++ b/packages/react-query/src/__tests__/useInfiniteQuery.test-d.tsx @@ -30,7 +30,7 @@ describe('pageParam', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for fetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { @@ -54,7 +54,7 @@ describe('pageParam', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for prefetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { diff --git a/packages/react-query/src/__tests__/useInfiniteQuery.test.tsx b/packages/react-query/src/__tests__/useInfiniteQuery.test.tsx index 92f2351175e..c09b9dfa83a 100644 --- a/packages/react-query/src/__tests__/useInfiniteQuery.test.tsx +++ b/packages/react-query/src/__tests__/useInfiniteQuery.test.tsx @@ -1205,7 +1205,7 @@ describe('useInfiniteQuery', () => { const renderStream = createRenderStream>>() - // eslint-disable-next-line @eslint-react/no-nested-component-definitions + // oxlint-disable-next-line @eslint-react/no-nested-component-definitions function Page() { const state = useInfiniteQuery({ queryKey: key, diff --git a/packages/react-query/src/__tests__/useMutation.test.tsx b/packages/react-query/src/__tests__/useMutation.test.tsx index 8a07e985020..cef386eaad8 100644 --- a/packages/react-query/src/__tests__/useMutation.test.tsx +++ b/packages/react-query/src/__tests__/useMutation.test.tsx @@ -1267,7 +1267,7 @@ describe('useMutation', () => { onlineMock.mockRestore() }) - // eslint-disable-next-line vitest/expect-expect + // oxlint-disable-next-line vitest/expect-expect it('should not change state if unmounted', () => { function Mutates() { const { mutate } = useMutation({ mutationFn: () => sleep(10) }) diff --git a/packages/react-query/src/__tests__/useQueries.test-d.tsx b/packages/react-query/src/__tests__/useQueries.test-d.tsx index 862e2317ecb..7ba72e082eb 100644 --- a/packages/react-query/src/__tests__/useQueries.test-d.tsx +++ b/packages/react-query/src/__tests__/useQueries.test-d.tsx @@ -805,7 +805,6 @@ describe('useQueries', () => { queryFn: fn && fn !== skipToken ? (ctx: QueryFunctionContext) => { - // eslint-disable-next-line vitest/valid-expect expectTypeOf(ctx.queryKey) return fn.call({}, ctx) } diff --git a/packages/react-query/src/__tests__/useQuery.test-d.tsx b/packages/react-query/src/__tests__/useQuery.test-d.tsx index 544d7c97163..e5dbed24497 100644 --- a/packages/react-query/src/__tests__/useQuery.test-d.tsx +++ b/packages/react-query/src/__tests__/useQuery.test-d.tsx @@ -360,7 +360,7 @@ describe('useQuery', () => { _data: DataTypeToEntity[TDataType], ) => 'test' - // eslint-disable-next-line @eslint-react/no-nested-component-definitions + // oxlint-disable-next-line @eslint-react/no-nested-component-definitions function Test(props: { dataType: TDataType }) { diff --git a/packages/react-query/src/__tests__/utils.tsx b/packages/react-query/src/__tests__/utils.tsx index 82ddcd39684..d2d0ba0e484 100644 --- a/packages/react-query/src/__tests__/utils.tsx +++ b/packages/react-query/src/__tests__/utils.tsx @@ -32,7 +32,7 @@ export function Blink({ const [shouldShow, setShouldShow] = React.useState(true) React.useEffect(() => { - // eslint-disable-next-line react-hooks-js/set-state-in-effect + // oxlint-disable-next-line react-hooks-js/set-state-in-effect setShouldShow(true) const timeout = setActTimeout(() => setShouldShow(false), duration) return () => { diff --git a/packages/solid-query/src/__tests__/queryOptions.test-d.tsx b/packages/solid-query/src/__tests__/queryOptions.test-d.tsx index 244945b7d49..56fc291c9cb 100644 --- a/packages/solid-query/src/__tests__/queryOptions.test-d.tsx +++ b/packages/solid-query/src/__tests__/queryOptions.test-d.tsx @@ -91,7 +91,7 @@ describe('queryOptions', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) diff --git a/packages/solid-query/src/__tests__/suspense.test.tsx b/packages/solid-query/src/__tests__/suspense.test.tsx index bf640eec8f6..bcf612b97c9 100644 --- a/packages/solid-query/src/__tests__/suspense.test.tsx +++ b/packages/solid-query/src/__tests__/suspense.test.tsx @@ -118,7 +118,7 @@ describe("useQuery's in Suspense mode", () => { expect(rendered.getByText('loading')).toBeInTheDocument() await vi.advanceTimersByTimeAsync(10) expect(rendered.getByText('data: 1')).toBeInTheDocument() - // eslint-disable-next-line cspell/spellchecker + // oxlint-disable-next-line cspell/spellchecker // TODO(lukemurray): in react this is 1 in solid this is 2 because suspense // occurs on read. expect(states.length).toBe(2) @@ -131,7 +131,7 @@ describe("useQuery's in Suspense mode", () => { expect(rendered.getByText('loading')).toBeInTheDocument() await vi.advanceTimersByTimeAsync(10) expect(rendered.getByText('data: 2')).toBeInTheDocument() - // eslint-disable-next-line cspell/spellchecker + // oxlint-disable-next-line cspell/spellchecker // TODO(lukemurray): in react this is 2 and in solid it is 4 expect(states.length).toBe(4) expect(states[3]).toMatchObject({ diff --git a/packages/solid-query/src/__tests__/useInfiniteQuery.test-d.tsx b/packages/solid-query/src/__tests__/useInfiniteQuery.test-d.tsx index 5de08b99b73..634185f32a5 100644 --- a/packages/solid-query/src/__tests__/useInfiniteQuery.test-d.tsx +++ b/packages/solid-query/src/__tests__/useInfiniteQuery.test-d.tsx @@ -30,7 +30,7 @@ describe('useInfiniteQuery', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for fetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { @@ -42,7 +42,7 @@ describe('useInfiniteQuery', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for prefetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { diff --git a/packages/solid-query/src/__tests__/useIsMutating.test.tsx b/packages/solid-query/src/__tests__/useIsMutating.test.tsx index a14453969c1..746bfa9cacc 100644 --- a/packages/solid-query/src/__tests__/useIsMutating.test.tsx +++ b/packages/solid-query/src/__tests__/useIsMutating.test.tsx @@ -235,7 +235,7 @@ describe('useIsMutating', () => { expect(rendered.getByText('mutating: 0')).toBeInTheDocument() }) - // eslint-disable-next-line vitest/expect-expect + // oxlint-disable-next-line vitest/expect-expect it('should not change state if unmounted', async () => { // We have to mock the MutationCache to not unsubscribe // the listener when the component is unmounted diff --git a/packages/solid-query/src/__tests__/useMutation.test.tsx b/packages/solid-query/src/__tests__/useMutation.test.tsx index c0e4c039f13..835dd4873ab 100644 --- a/packages/solid-query/src/__tests__/useMutation.test.tsx +++ b/packages/solid-query/src/__tests__/useMutation.test.tsx @@ -1018,7 +1018,7 @@ describe('useMutation', () => { }) }) - // eslint-disable-next-line vitest/expect-expect + // oxlint-disable-next-line vitest/expect-expect it('should not change state if unmounted', () => { function Mutates() { const mutation = useMutation(() => ({ mutationFn: () => sleep(10) })) diff --git a/packages/solid-query/src/__tests__/useQueries.test-d.tsx b/packages/solid-query/src/__tests__/useQueries.test-d.tsx index 7492227491c..a57e4643de6 100644 --- a/packages/solid-query/src/__tests__/useQueries.test-d.tsx +++ b/packages/solid-query/src/__tests__/useQueries.test-d.tsx @@ -826,7 +826,6 @@ describe('useQueries', () => { queryKey: key, queryFn: fn ? (ctx: QueryFunctionContext) => { - // eslint-disable-next-line vitest/valid-expect expectTypeOf(ctx.queryKey) return ( fn as QueryFunction diff --git a/packages/solid-query/src/__tests__/useQueries.test.tsx b/packages/solid-query/src/__tests__/useQueries.test.tsx index 4c95af40eef..88128ad67ed 100644 --- a/packages/solid-query/src/__tests__/useQueries.test.tsx +++ b/packages/solid-query/src/__tests__/useQueries.test.tsx @@ -72,7 +72,7 @@ describe('useQueries', () => { expect(results[2]).toMatchObject([{ data: 1 }, { data: 2 }]) }) - // eslint-disable-next-line vitest/expect-expect + // oxlint-disable-next-line vitest/expect-expect it('should not change state if unmounted', async () => { const key1 = queryKey() diff --git a/packages/solid-query/src/__tests__/useQuery.test.tsx b/packages/solid-query/src/__tests__/useQuery.test.tsx index 123a37e93c6..1746d2ddf4b 100644 --- a/packages/solid-query/src/__tests__/useQuery.test.tsx +++ b/packages/solid-query/src/__tests__/useQuery.test.tsx @@ -4177,7 +4177,7 @@ describe('useQuery', () => { readonly [typeof key, number] > = async (ctx) => { const [, limit] = ctx.queryKey - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + // oxlint-disable-next-line typescript/no-unnecessary-condition const value = limit % 2 && ctx.signal ? 'abort' : `data ${limit}` await sleep(25) return value diff --git a/packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts b/packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts index 6e4524ffbb8..e8747fa49ca 100644 --- a/packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts +++ b/packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts @@ -30,7 +30,7 @@ describe('createInfiniteQuery', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for fetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { @@ -42,7 +42,7 @@ describe('createInfiniteQuery', () => { it('should define type of param passed to queryFunctionContext with initialPageParam for prefetchInfiniteQuery', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKey(), queryFn: ({ pageParam }) => { diff --git a/packages/svelte-query/tests/createQueries/createQueries.test-d.ts b/packages/svelte-query/tests/createQueries/createQueries.test-d.ts index faf30aff858..5d3d0566241 100644 --- a/packages/svelte-query/tests/createQueries/createQueries.test-d.ts +++ b/packages/svelte-query/tests/createQueries/createQueries.test-d.ts @@ -610,7 +610,6 @@ describe('createQueries', () => { queryKey: key, queryFn: fn ? (ctx: QueryFunctionContext) => { - // eslint-disable-next-line vitest/valid-expect expectTypeOf(ctx.queryKey) return ( fn as QueryFunction diff --git a/packages/svelte-query/tests/infiniteQueryOptions.test-d.ts b/packages/svelte-query/tests/infiniteQueryOptions.test-d.ts index ca2a3196863..a46453c20ea 100644 --- a/packages/svelte-query/tests/infiniteQueryOptions.test-d.ts +++ b/packages/svelte-query/tests/infiniteQueryOptions.test-d.ts @@ -129,7 +129,7 @@ describe('infiniteQueryOptions', () => { initialPageParam: 1, }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery(options) expectTypeOf(data).toEqualTypeOf>() diff --git a/packages/svelte-query/tests/queryOptions.test-d.ts b/packages/svelte-query/tests/queryOptions.test-d.ts index 283361abc69..5bd2defb9e0 100644 --- a/packages/svelte-query/tests/queryOptions.test-d.ts +++ b/packages/svelte-query/tests/queryOptions.test-d.ts @@ -85,7 +85,7 @@ describe('queryOptions', () => { queryFn: () => Promise.resolve(5), }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchQuery(options) expectTypeOf(data).toEqualTypeOf() }) diff --git a/packages/vue-query/src/__tests__/queryClient.test-d.ts b/packages/vue-query/src/__tests__/queryClient.test-d.ts index 9c6b5fc8ca8..1e4197dc933 100644 --- a/packages/vue-query/src/__tests__/queryClient.test-d.ts +++ b/packages/vue-query/src/__tests__/queryClient.test-d.ts @@ -115,7 +115,7 @@ describe('setQueryData', () => { describe('fetchInfiniteQuery', () => { it('should allow passing pages', async () => { const key = queryKey() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data = await new QueryClient().fetchInfiniteQuery({ queryKey: key, queryFn: () => Promise.resolve('string'), diff --git a/packages/vue-query/src/__tests__/queryClient.test.ts b/packages/vue-query/src/__tests__/queryClient.test.ts index f2010cb0ff5..7aa623a4cbb 100644 --- a/packages/vue-query/src/__tests__/queryClient.test.ts +++ b/packages/vue-query/src/__tests__/queryClient.test.ts @@ -101,7 +101,7 @@ describe('QueryCache', () => { it('should properly unwrap parameter', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.ensureQueryData({ queryKey: queryKeyRef, queryFn: fn, @@ -364,7 +364,7 @@ describe('QueryCache', () => { it('should properly unwrap parameter', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchQuery({ queryKey: queryKeyRef, }) @@ -424,7 +424,7 @@ describe('QueryCache', () => { it('should properly unwrap parameters', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchQuery({ queryKey: queryKeyRef, queryFn: fn }) expect(QueryClientOrigin.prototype.prefetchQuery).toHaveBeenCalledWith({ @@ -438,7 +438,7 @@ describe('QueryCache', () => { it('should properly unwrap parameter', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery({ queryKey: queryKeyRef, initialPageParam: 0, @@ -462,7 +462,7 @@ describe('QueryCache', () => { getNextPageParam: () => 12, }) - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.fetchInfiniteQuery(options) expect( @@ -532,7 +532,7 @@ describe('QueryCache', () => { it('should properly unwrap parameters', () => { const queryClient = new QueryClient() - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test queryClient.prefetchInfiniteQuery({ queryKey: queryKeyRef, queryFn: fn, diff --git a/packages/vue-query/src/__tests__/queryOptions.test-d.ts b/packages/vue-query/src/__tests__/queryOptions.test-d.ts index e303edacc20..f53869457c5 100644 --- a/packages/vue-query/src/__tests__/queryOptions.test-d.ts +++ b/packages/vue-query/src/__tests__/queryOptions.test-d.ts @@ -163,7 +163,7 @@ describe('queryOptions', () => { // Should not error const data = queryClient.invalidateQueries(options) // Should not error - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered direct test const data2 = queryClient.fetchQuery(options) expectTypeOf(data).toEqualTypeOf>() diff --git a/packages/vue-query/src/queryClient.ts b/packages/vue-query/src/queryClient.ts index 39078fd2caf..851a40010ab 100644 --- a/packages/vue-query/src/queryClient.ts +++ b/packages/vue-query/src/queryClient.ts @@ -118,7 +118,7 @@ export class QueryClient extends QC { EnsureQueryDataOptions >, ): Promise { - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.ensureQueryData(cloneDeepUnref(options)) } @@ -366,7 +366,7 @@ export class QueryClient extends QC { FetchQueryOptions >, ): Promise { - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.fetchQuery(cloneDeepUnref(options)) } @@ -401,7 +401,7 @@ export class QueryClient extends QC { FetchQueryOptions >, ): Promise { - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.prefetchQuery(cloneDeepUnref(options)) } @@ -523,7 +523,7 @@ export class QueryClient extends QC { > >, ): Promise> { - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.fetchInfiniteQuery(cloneDeepUnref(options)) } @@ -579,7 +579,7 @@ export class QueryClient extends QC { > >, ): Promise { - // eslint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation + // oxlint-disable-next-line tanstack-query/no-restricted-syntax -- grandfathered deprecated wrapper implementation return super.prefetchInfiniteQuery(cloneDeepUnref(options)) } diff --git a/packages/vue-query/src/utils.ts b/packages/vue-query/src/utils.ts index b4c0ad62cda..34bc29d4b0c 100644 --- a/packages/vue-query/src/utils.ts +++ b/packages/vue-query/src/utils.ts @@ -146,7 +146,7 @@ export function cloneDeepUnref( * @param value - The value to check. * @returns `true` if `value` is a plain object. */ -// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types +// oxlint-disable-next-line typescript/no-wrapper-object-types function isPlainObject(value: unknown): value is Object { if (Object.prototype.toString.call(value) !== '[object Object]') { return false From 15b4f70f423d0f1eb78c4803b80fb32bcbe99ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Curley?= Date: Thu, 8 Oct 2026 21:58:46 +0100 Subject: [PATCH 3/5] chore: lint expectTypeOf with vitest valid-expect Oxlint's native vitest/valid-expect only checks `expect` calls, so load @vitest/eslint-plugin as a JS plugin for this rule to keep flagging `expectTypeOf` calls without a matcher, and restore the directives for the intentional ones. Co-Authored-By: Claude Opus 5.5 --- oxlint.config.ts | 4 ++- package.json | 1 + .../createQueriesController.test-d.ts | 1 + .../src/__tests__/useQueries.test-d.tsx | 1 + .../src/__tests__/useQueries.test-d.tsx | 1 + .../src/__tests__/useQueries.test-d.tsx | 1 + .../createQueries/createQueries.test-d.ts | 1 + pnpm-lock.yaml | 31 +++++++++++++++++++ 8 files changed, 40 insertions(+), 1 deletion(-) diff --git a/oxlint.config.ts b/oxlint.config.ts index d4ee4b0cc05..bbc284f4d27 100644 --- a/oxlint.config.ts +++ b/oxlint.config.ts @@ -19,6 +19,8 @@ export default defineConfig({ jsPlugins: [ { name: 'import-js', specifier: 'eslint-plugin-import-x' }, { name: 'jsdoc-js', specifier: 'eslint-plugin-jsdoc' }, + // Unlike the native rule, also checks `expectTypeOf` calls + { name: 'vitest-js', specifier: '@vitest/eslint-plugin' }, { name: 'cspell', specifier: '@cspell/eslint-plugin' }, '@stylistic/eslint-plugin', // Absolute path so that package configs can extend this config @@ -298,7 +300,7 @@ export default defineConfig({ 'vitest/prefer-called-exactly-once-with': 'error', 'vitest/require-local-test-context-for-concurrent-snapshots': 'error', 'vitest/valid-describe-callback': 'error', - 'vitest/valid-expect': 'error', + 'vitest-js/valid-expect': 'error', 'vitest/valid-expect-in-promise': 'error', 'vitest/valid-title': 'error', }, diff --git a/package.json b/package.json index 831cc496e0b..947ef567875 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "@testing-library/jest-dom": "^6.8.0", "@types/node": "^22.15.3", "@vitest/coverage-istanbul": "4.1.11", + "@vitest/eslint-plugin": "^1.6.27", "eslint": "catalog:", "eslint-plugin-import-x": "^4.17.1", "eslint-plugin-jsdoc": "^65.0.1", diff --git a/packages/lit-query/src/__tests__/createQueriesController.test-d.ts b/packages/lit-query/src/__tests__/createQueriesController.test-d.ts index 5556941ed62..414bc6b81bb 100644 --- a/packages/lit-query/src/__tests__/createQueriesController.test-d.ts +++ b/packages/lit-query/src/__tests__/createQueriesController.test-d.ts @@ -976,6 +976,7 @@ describe('createQueriesController', () => { queryFn: fn && fn !== skipToken ? (ctx: QueryFunctionContext) => { + // oxlint-disable-next-line vitest-js/valid-expect expectTypeOf(ctx.queryKey) return fn.call({}, ctx) } diff --git a/packages/preact-query/src/__tests__/useQueries.test-d.tsx b/packages/preact-query/src/__tests__/useQueries.test-d.tsx index ca8cbaf369e..6aa5d9f6079 100644 --- a/packages/preact-query/src/__tests__/useQueries.test-d.tsx +++ b/packages/preact-query/src/__tests__/useQueries.test-d.tsx @@ -806,6 +806,7 @@ describe('useQueries', () => { queryFn: fn && fn !== skipToken ? (ctx: QueryFunctionContext) => { + // oxlint-disable-next-line vitest-js/valid-expect expectTypeOf(ctx.queryKey) return fn.call({}, ctx) } diff --git a/packages/react-query/src/__tests__/useQueries.test-d.tsx b/packages/react-query/src/__tests__/useQueries.test-d.tsx index 7ba72e082eb..a5da2e919ba 100644 --- a/packages/react-query/src/__tests__/useQueries.test-d.tsx +++ b/packages/react-query/src/__tests__/useQueries.test-d.tsx @@ -805,6 +805,7 @@ describe('useQueries', () => { queryFn: fn && fn !== skipToken ? (ctx: QueryFunctionContext) => { + // oxlint-disable-next-line vitest-js/valid-expect expectTypeOf(ctx.queryKey) return fn.call({}, ctx) } diff --git a/packages/solid-query/src/__tests__/useQueries.test-d.tsx b/packages/solid-query/src/__tests__/useQueries.test-d.tsx index a57e4643de6..b94a3aca38e 100644 --- a/packages/solid-query/src/__tests__/useQueries.test-d.tsx +++ b/packages/solid-query/src/__tests__/useQueries.test-d.tsx @@ -826,6 +826,7 @@ describe('useQueries', () => { queryKey: key, queryFn: fn ? (ctx: QueryFunctionContext) => { + // oxlint-disable-next-line vitest-js/valid-expect expectTypeOf(ctx.queryKey) return ( fn as QueryFunction diff --git a/packages/svelte-query/tests/createQueries/createQueries.test-d.ts b/packages/svelte-query/tests/createQueries/createQueries.test-d.ts index 5d3d0566241..37b1cbb3765 100644 --- a/packages/svelte-query/tests/createQueries/createQueries.test-d.ts +++ b/packages/svelte-query/tests/createQueries/createQueries.test-d.ts @@ -610,6 +610,7 @@ describe('createQueries', () => { queryKey: key, queryFn: fn ? (ctx: QueryFunctionContext) => { + // oxlint-disable-next-line vitest-js/valid-expect expectTypeOf(ctx.queryKey) return ( fn as QueryFunction diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 85f7070a5ca..0fe845c5b57 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -305,6 +305,9 @@ importers: '@vitest/coverage-istanbul': specifier: 4.1.11 version: 4.1.11(supports-color@7.2.0)(vitest@4.1.11) + '@vitest/eslint-plugin': + specifier: ^1.6.27 + version: 1.6.27(@typescript-eslint/eslint-plugin@8.70.1(@typescript-eslint/parser@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)(vitest@4.1.11) eslint: specifier: 'catalog:' version: 9.39.4(jiti@2.7.0)(supports-color@7.2.0) @@ -9188,6 +9191,22 @@ packages: peerDependencies: vitest: 4.1.11 + '@vitest/eslint-plugin@1.6.27': + resolution: {integrity: sha512-X1RCAfwbatG4GFbJ/1PIHP9MSZMt0JJThqbYID+vS4L783k6QGlLPe421wQE8dHXuGCcenVLsydiM4qzsYWxhg==} + engines: {node: '>=18'} + peerDependencies: + '@typescript-eslint/eslint-plugin': '*' + eslint: '>=8.57.0' + typescript: '>=5.0.0' + vitest: '*' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + typescript: + optional: true + vitest: + optional: true + '@vitest/expect@4.1.11': resolution: {integrity: sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==} @@ -23807,6 +23826,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@vitest/eslint-plugin@1.6.27(@typescript-eslint/eslint-plugin@8.70.1(@typescript-eslint/parser@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)(vitest@4.1.11)': + dependencies: + '@typescript-eslint/scope-manager': 8.71.0 + '@typescript-eslint/utils': 8.71.0(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + eslint: 9.39.4(jiti@2.7.0)(supports-color@7.2.0) + optionalDependencies: + '@typescript-eslint/eslint-plugin': 8.70.1(@typescript-eslint/parser@8.70.1(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@9.39.4(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + typescript: 6.0.3 + vitest: 4.1.11(@types/node@22.19.15)(@vitest/coverage-istanbul@4.1.11)(jsdom@27.4.0(supports-color@7.2.0))(msw@2.12.14(@types/node@22.19.15)(typescript@6.0.3))(vite@8.3.1(@types/node@22.19.15)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.90.0)(terser@5.46.1)(tsx@4.21.0)(yaml@2.9.0)) + transitivePeerDependencies: + - supports-color + '@vitest/expect@4.1.11': dependencies: '@standard-schema/spec': 1.1.0 From be2c74ddf600d04d104edcee57d565ab1b0db722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Curley?= Date: Fri, 9 Oct 2026 14:05:09 +0100 Subject: [PATCH 4/5] docs(vue-query): describe the MutationResult type The type alias became public in #11796 without a JSDoc comment, which fails jsdoc/require-jsdoc. Add a description and regenerate the vue reference docs. Co-Authored-By: Claude Opus 5.5 --- docs/framework/vue/reference/functions/useMutation.md | 2 +- docs/framework/vue/reference/type-aliases/MutationResult.md | 5 ++++- .../vue/reference/type-aliases/UseMutationOptions.md | 2 +- .../vue/reference/type-aliases/UseMutationReturnType.md | 2 +- packages/vue-query/src/useMutation.ts | 4 ++++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/framework/vue/reference/functions/useMutation.md b/docs/framework/vue/reference/functions/useMutation.md index 05c11e8fc4f..76469cce70f 100644 --- a/docs/framework/vue/reference/functions/useMutation.md +++ b/docs/framework/vue/reference/functions/useMutation.md @@ -9,7 +9,7 @@ redirect_from: function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationReturnType; ``` -Defined in: [packages/vue-query/src/useMutation.ts:233](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L233) +Defined in: [packages/vue-query/src/useMutation.ts:237](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L237) Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. `useMutation` is the composable for that. diff --git a/docs/framework/vue/reference/type-aliases/MutationResult.md b/docs/framework/vue/reference/type-aliases/MutationResult.md index 9ac29845964..d4e688cfceb 100644 --- a/docs/framework/vue/reference/type-aliases/MutationResult.md +++ b/docs/framework/vue/reference/type-aliases/MutationResult.md @@ -7,7 +7,10 @@ title: MutationResult type MutationResult = DistributiveOmit, "mutate" | "reset">; ``` -Defined in: [packages/vue-query/src/useMutation.ts:25](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L25) +Defined in: [packages/vue-query/src/useMutation.ts:29](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L29) + +The plain (non-`Ref`) state of a mutation that `useMutation` exposes: [MutationObserverResult](MutationObserverResult.md) +without `mutate` and `reset` ## Type Parameters diff --git a/docs/framework/vue/reference/type-aliases/UseMutationOptions.md b/docs/framework/vue/reference/type-aliases/UseMutationOptions.md index 161d992ee94..9671d6a38d6 100644 --- a/docs/framework/vue/reference/type-aliases/UseMutationOptions.md +++ b/docs/framework/vue/reference/type-aliases/UseMutationOptions.md @@ -9,7 +9,7 @@ type UseMutationOptions = | (() => MaybeRefDeep>); ``` -Defined in: [packages/vue-query/src/useMutation.ts:35](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L35) +Defined in: [packages/vue-query/src/useMutation.ts:39](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L39) The options accepted by `useMutation`: [MutationOptions](MutationOptions.md) as a plain object, a `ref`, or a reactive getter. diff --git a/docs/framework/vue/reference/type-aliases/UseMutationReturnType.md b/docs/framework/vue/reference/type-aliases/UseMutationReturnType.md index 08b28764db4..e8617f79712 100644 --- a/docs/framework/vue/reference/type-aliases/UseMutationReturnType.md +++ b/docs/framework/vue/reference/type-aliases/UseMutationReturnType.md @@ -7,7 +7,7 @@ title: UseMutationReturnType type UseMutationReturnType = ToRefs> & object; ``` -Defined in: [packages/vue-query/src/useMutation.ts:61](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L61) +Defined in: [packages/vue-query/src/useMutation.ts:65](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L65) The result of `useMutation`: the [MutationObserverResult](MutationObserverResult.md) properties wrapped in `Ref`s, plus the fire-and-forget `mutate`, the awaitable `mutateAsync`, and `reset`. diff --git a/packages/vue-query/src/useMutation.ts b/packages/vue-query/src/useMutation.ts index 847094a0597..cdfcfc7b1c6 100644 --- a/packages/vue-query/src/useMutation.ts +++ b/packages/vue-query/src/useMutation.ts @@ -22,6 +22,10 @@ import type { import type { MaybeRefDeep, MutationOptions } from './types' import type { QueryClient } from './queryClient' +/** + * The plain (non-`Ref`) state of a mutation that `useMutation` exposes: {@link MutationObserverResult} + * without `mutate` and `reset` + */ export type MutationResult = DistributiveOmit< MutationObserverResult, From 46867dd4e04391c2e98b323442944df8111dfb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Curley?= Date: Fri, 9 Oct 2026 14:37:16 +0100 Subject: [PATCH 5/5] docs(vue-query): clarify MutationResult description MutationResult is the plain shape useMutation wraps in refs, not what it exposes directly. Co-Authored-By: Claude Opus 5.5 --- docs/framework/vue/reference/type-aliases/MutationResult.md | 2 +- packages/vue-query/src/useMutation.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/framework/vue/reference/type-aliases/MutationResult.md b/docs/framework/vue/reference/type-aliases/MutationResult.md index d4e688cfceb..34f8fe9277e 100644 --- a/docs/framework/vue/reference/type-aliases/MutationResult.md +++ b/docs/framework/vue/reference/type-aliases/MutationResult.md @@ -9,7 +9,7 @@ type MutationResult = DistributiveOm Defined in: [packages/vue-query/src/useMutation.ts:29](https://github.com/TanStack/query/blob/main/packages/vue-query/src/useMutation.ts#L29) -The plain (non-`Ref`) state of a mutation that `useMutation` exposes: [MutationObserverResult](MutationObserverResult.md) +The plain mutation result shape that `useMutation` wraps in `Ref`s: [MutationObserverResult](MutationObserverResult.md) without `mutate` and `reset` ## Type Parameters diff --git a/packages/vue-query/src/useMutation.ts b/packages/vue-query/src/useMutation.ts index cdfcfc7b1c6..f401b7f1a9b 100644 --- a/packages/vue-query/src/useMutation.ts +++ b/packages/vue-query/src/useMutation.ts @@ -23,7 +23,7 @@ import type { MaybeRefDeep, MutationOptions } from './types' import type { QueryClient } from './queryClient' /** - * The plain (non-`Ref`) state of a mutation that `useMutation` exposes: {@link MutationObserverResult} + * The plain mutation result shape that `useMutation` wraps in `Ref`s: {@link MutationObserverResult} * without `mutate` and `reset` */ export type MutationResult =