Skip to content

chore(preact-query*): enable '@typescript-eslint/array-type' and '@typescript-eslint/no-unnecessary-type-assertion' - #11925

Merged
sukvvon merged 2 commits into
mainfrom
chore/preact-query-array-type-and-type-assertion-rules
Oct 8, 2026
Merged

sukvvon merged 2 commits into
mainfrom
chore/preact-query-array-type-and-type-assertion-rules

Conversation

@sukvvon

@sukvvon sukvvon commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

The preact packages turned off @typescript-eslint/array-type and @typescript-eslint/no-unnecessary-type-assertion, which the root config enforces for every other package.

  • Remove the two off overrides from the eslint.config.js of preact-query, preact-query-devtools and preact-query-persist-client.
  • Fix the violations with eslint --fix, all in preact-query tests:
    • array-type: any[] → Array<any> in __tests__/ErrorBoundary/.
    • no-unnecessary-type-assertion: drop as any from setQueryData(key, undefined) in useSuspenseQuery.test.tsx.

No source files change.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Chores
    • Updated linting rules across the packages to use their inherited configurations.
  • Tests
    • Updated array type notation in ErrorBoundary test types and helpers.
    • Removed an unnecessary type cast from a suspense query test.

@sukvvon sukvvon self-assigned this Oct 8, 2026
@changeset-bot

changeset-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1182cab

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud

nx-cloud Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 1182cab

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 3m 42s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-08 07:22:06 UTC

…pescript-eslint/no-unnecessary-type-assertion'
@sukvvon
sukvvon force-pushed the chore/preact-query-array-type-and-type-assertion-rules branch from ebbc109 to 3721dc2 Compare October 8, 2026 01:15
@sukvvon sukvvon changed the title chore(preact-query*): enable '@typescript-eslint/array-type' and '@typescript-eslint/no-unnecessary-type-assertion' to match the other packages chore(preact-query*): enable '@typescript-eslint/array-type' and '@typescript-eslint/no-unnecessary-type-assertion' Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 24 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/query-core 5.104.1 → 5.104.2 Changeset
@tanstack/angular-query-experimental 5.104.1 → 5.104.2 Dependent
@tanstack/angular-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/eslint-plugin-query 5.104.1 → 5.104.2 Dependent
@tanstack/lit-query 0.2.26 → 0.2.27 Dependent
@tanstack/preact-query 5.104.1 → 5.104.2 Dependent
@tanstack/preact-query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/preact-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/query-async-storage-persister 5.104.1 → 5.104.2 Dependent
@tanstack/query-broadcast-client-experimental 5.104.1 → 5.104.2 Dependent
@tanstack/query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/query-persist-client-core 5.104.1 → 5.104.2 Dependent
@tanstack/query-sync-storage-persister 5.104.1 → 5.104.2 Dependent
@tanstack/react-query 5.104.1 → 5.104.2 Dependent
@tanstack/react-query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/react-query-next-experimental 5.104.1 → 5.104.2 Dependent
@tanstack/react-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/solid-query 5.104.1 → 5.104.2 Dependent
@tanstack/solid-query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/solid-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/svelte-query 6.3.1 → 6.3.2 Dependent
@tanstack/svelte-query-devtools 6.3.1 → 6.3.2 Dependent
@tanstack/svelte-query-persist-client 6.3.1 → 6.3.2 Dependent
@tanstack/vue-query 5.104.1 → 5.104.2 Dependent
@tanstack/vue-query-devtools 6.3.1 → 6.3.2 Dependent

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: TanStack/query/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ce78a173-8c9e-4627-8cfb-d3c55d0983f8
📥 Commits

Reviewing files that changed from the base of the PR and between 3721dc2 and 1182cab.

📒 Files selected for processing (3)
  • packages/preact-query-devtools/eslint.config.js
  • packages/preact-query-persist-client/eslint.config.js
  • packages/preact-query/eslint.config.js
 ___________________________________________________________________________
< Your code and I are going to be best friends. Very critical best friends. >
 ---------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: TanStack/query/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e71ec600-197d-47f7-96a5-d82feb0aac04
📥 Commits

Reviewing files that changed from the base of the PR and between d169ee8 and 3721dc2.

📒 Files selected for processing (7)
  • packages/preact-query-devtools/eslint.config.js
  • packages/preact-query-persist-client/eslint.config.js
  • packages/preact-query/eslint.config.js
  • packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundary.ts
  • packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundaryContext.ts
  • packages/preact-query/src/__tests__/ErrorBoundary/types.ts
  • packages/preact-query/src/__tests__/useSuspenseQuery.test.tsx
💤 Files with no reviewable changes (3)
  • packages/preact-query-devtools/eslint.config.js
  • packages/preact-query-persist-client/eslint.config.js
  • packages/preact-query/eslint.config.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Three package ESLint configurations remove overrides for two rules. ErrorBoundary test types change array syntax, and a Suspense query test removes an any cast from a value passed to setQueryData.

Changes

Preact Query lint and test updates

Layer / File(s) Summary
Remove ESLint rule overrides
packages/preact-query-devtools/eslint.config.js, packages/preact-query-persist-client/eslint.config.js, packages/preact-query/eslint.config.js
The three configurations remove overrides that disabled @typescript-eslint/array-type and @typescript-eslint/no-unnecessary-type-assertion.
Update test types and assertion
packages/preact-query/src/__tests__/ErrorBoundary/*, packages/preact-query/src/__tests__/useSuspenseQuery.test.tsx
ErrorBoundary test types use Array<any> instead of any[]. The Suspense query test passes undefined to setQueryData without an any cast.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 3721d

The changed packages pass ESLint with the newly enabled rules; no actionable merge-blocking risk remains in the reviewed changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description explains the rule changes, affected packages, test updates, validation command, AI policy status, and release impact. It follows the required template.
Title check ✅ Passed The title clearly identifies the two ESLint rules being enabled in the Preact packages. It matches the main change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@11925

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@11925

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11925

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@11925

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@11925

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@11925

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@11925

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@11925

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@11925

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@11925

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@11925

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@11925

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@11925

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@11925

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@11925

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@11925

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@11925

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@11925

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@11925

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@11925

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@11925

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@11925

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@11925

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@11925

commit: 1182cab

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.73 KB (0%)
react minimal 8.58 KB (0%)

@sukvvon
sukvvon merged commit c7a2258 into main Oct 8, 2026
8 of 9 checks passed
@sukvvon
sukvvon deleted the chore/preact-query-array-type-and-type-assertion-rules branch October 8, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant