fix(eslint-plugin-query): flag rest destructuring from custom hooks#10708
Open
raashish1601 wants to merge 1 commit into
Open
fix(eslint-plugin-query): flag rest destructuring from custom hooks#10708raashish1601 wants to merge 1 commit into
raashish1601 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #8951.
authored-by: codex
The
no-rest-destructuringrule previously only detected direct TanStack Query hook calls. This follows local function and variable references so custom hooks that directly return a TanStack Query result are handled too, including block-bodied arrow hooks and hooks declared after their component.A non-TanStack custom hook case is covered to avoid reporting hooks from other packages.
Validation
corepack pnpm exec vitest run --globals packages/eslint-plugin-query/src/__tests__/no-rest-destructuring.test.tsPASS, 38 passedcorepack pnpm exec eslint --format stylish packages/eslint-plugin-query/src/rules/no-rest-destructuring/no-rest-destructuring.rule.ts packages/eslint-plugin-query/src/__tests__/no-rest-destructuring.test.tsPASScorepack pnpm exec prettier --check "packages/eslint-plugin-query/src/rules/no-rest-destructuring/no-rest-destructuring.rule.ts" "packages/eslint-plugin-query/src/__tests__/no-rest-destructuring.test.ts"PASScorepack pnpm exec tsc --project packages/eslint-plugin-query/tsconfig.prod.json --pretty falsePASSgit diff --checkPASSBroader package scripts were also attempted and appear blocked by unrelated local workspace issues:
corepack pnpm --filter @tanstack/eslint-plugin-query test:lib -- --run --globalsruns 1620 tests successfully but one existingno-void-query-fncase times out; Vitest also logs missing generated example tsconfigs such as.svelte-kit/tsconfig.jsonand.nuxt/tsconfig.json.corepack pnpm --filter @tanstack/eslint-plugin-query test:eslintexits withSyntaxError: Unexpected token '.'before linting the changed files; direct ESLint on the changed files passes.corepack pnpm --filter @tanstack/eslint-plugin-query buildcompiles JS and TSC successfully, then the DTS phase fails resolvingajv/dist/corethroughajv-draft-04/@microsoft/api-extractorin this local install.