fix(eslint-plugin-query): add TypeScript v6 to peerDependencies#10360
fix(eslint-plugin-query): add TypeScript v6 to peerDependencies#10360mixelburg wants to merge 1 commit intoTanStack:mainfrom
Conversation
📝 WalkthroughWalkthroughUpdated the TypeScript peer dependency in eslint-plugin-query to support both TypeScript v5.4.0+ and v6.0.0+, expanding compatibility with the recently released TypeScript major version while maintaining backward compatibility. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/eslint-plugin-query/package.json`:
- Line 72: The package.json currently pins `@typescript-eslint/utils` at ^8.48.0
which blocks TypeScript 6 support; update the dependency entry for
"@typescript-eslint/utils" in package.json to "^8.58.0" so its peerDependency
range includes TypeScript 6 (>=4.8.4 <6.1.0), then run install/update lockfile
to reflect the change (verify package.json's dependencies object contains
"@typescript-eslint/utils": "^8.58.0").
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9e847e2d-6ecf-4947-9e44-a18f6e16a8b6
📒 Files selected for processing (1)
packages/eslint-plugin-query/package.json
| "peerDependencies": { | ||
| "eslint": "^8.57.0 || ^9.0.0", | ||
| "typescript": "^5.4.0" | ||
| "typescript": "^5.4.0 || ^6.0.0" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify `@typescript-eslint/utils`@^8.48.0 actually supports TypeScript v6
echo "=== Checking `@typescript-eslint/utils`@8.48.0 peerDependencies ==="
npm view `@typescript-eslint/utils`@8.48.0 peerDependencies
echo -e "\n=== Checking `@typescript-eslint/utils`@8.58.0 peerDependencies (version mentioned in PR) ==="
npm view `@typescript-eslint/utils`@8.58.0 peerDependencies
echo -e "\n=== Checking latest `@typescript-eslint/utils` in 8.x range ==="
npm view `@typescript-eslint/utils`@^8.48.0 peerDependenciesRepository: TanStack/query
Length of output: 2106
🏁 Script executed:
#!/bin/bash
# Check if a changeset file exists for this PR
echo "=== Searching for changeset files ==="
fd -e md . .changeset -x cat {}Repository: TanStack/query
Length of output: 95
🌐 Web query:
What are the breaking changes in TypeScript 6.0.0 compiler API compared to TypeScript 5.x, specifically for getTypeChecker, getTypeAtLocation, getAwaitedType, getCallSignatures, and type flags?
💡 Result:
No breaking changes found in TypeScript 6.0.0 compiler API for getTypeChecker, getTypeAtLocation, getAwaitedType, getCallSignatures, or type flags compared to 5.x. Official release notes, iteration plans, and company feedback (Google, Bloomberg) emphasize configuration defaults, deprecations like baseUrl/outFile, lib.d.ts updates, and type inference tweaks, but explicitly state API compatibility with 5.9 is maintained. The compiler API (tsserverlibrary) appears unchanged for these methods based on available sources.
Citations:
- 1: https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/
- 2: TypeScript 6.0 Iteration Plan microsoft/TypeScript#63085
- 3: https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-beta
- 4: https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-rc/
- 5: https://devblogs.microsoft.com/typescript/announcing-typescript-6-0
- 6: https://www.typescriptlang.org
- 7: Make tsserver.js a library microsoft/TypeScript#39291
- 8: https://www.npmjs.com/package/typescript-language-server
- 9: https://github.com/microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29
- 10: 6.0 Migration Guide microsoft/TypeScript#62508
- 11: Bloomberg feedback for 6.0 microsoft/TypeScript#63245
🏁 Script executed:
# Check the current `@typescript-eslint/utils` version in package.json and look for rule changes
cd packages/eslint-plugin-query
cat -n package.json | grep -A5 -B5 "@typescript-eslint/utils"Repository: TanStack/query
Length of output: 395
🏁 Script executed:
# Search for any rule files that were modified in this PR to understand scope of changes
fd "\.rule\.ts$" packages/eslint-plugin-query/src/rules --exec basename {}Repository: TanStack/query
Length of output: 259
🏁 Script executed:
# List the .changeset directory to see what files exist
ls -la .changeset/ 2>/dev/null || echo "No .changeset directory found"Repository: TanStack/query
Length of output: 232
🏁 Script executed:
# Also check git status to see all modified/added files in this PR
git status --short | head -20Repository: TanStack/query
Length of output: 71
🏁 Script executed:
# Look for any file that might document TypeScript 6 support or version bumps
git diff --name-only HEAD~1 2>/dev/null | grep -E "(changeset|package\.json)" || echo "Cannot get git diff"Repository: TanStack/query
Length of output: 77
🏁 Script executed:
# Check if the exhaustive-deps-allowlist.md changeset mentioned in learnings exists
cat .changeset/exhaustive-deps-allowlist.md 2>/dev/null || echo "File not found"Repository: TanStack/query
Length of output: 72
🏁 Script executed:
# List all files in .changeset directory
ls -la .changeset/Repository: TanStack/query
Length of output: 232
🏁 Script executed:
# Check the current rule files to see if any have TypeScript 6 related changes
git log --oneline --all -- packages/eslint-plugin-query/src/rules/ 2>/dev/null | head -10 || echo "No git log available"Repository: TanStack/query
Length of output: 815
🏁 Script executed:
# Check the exact state of the typescript peer dependency in package.json
cat packages/eslint-plugin-query/package.json | jq '.peerDependencies.typescript'Repository: TanStack/query
Length of output: 76
🏁 Script executed:
# Check if there's a changeset in the parent directory or elsewhere
find . -name "*.md" -path "*/.changeset/*" 2>/dev/null | head -10Repository: TanStack/query
Length of output: 40
🏁 Script executed:
# Verify the exact npm package versions that support TypeScript 6 support in `@typescript-eslint`
npm view `@typescript-eslint/utils` versions --json | jq '.[] | select(. == "8.58.0" or . == "8.57.0" or . == "8.48.0")'Repository: TanStack/query
Length of output: 84
Update @typescript-eslint/utils to ^8.58.0 to support TypeScript v6.
The TypeScript v6 peer dependency support cannot be added without updating @typescript-eslint/utils. The current version constraint ^8.48.0 (line 61) pulls versions 8.48.0 through 8.57.x, all of which have peer dependency typescript: >=4.8.4 <6.0.0—explicitly excluding TypeScript 6.0.0. Only @typescript-eslint/utils@8.58.0+ support TypeScript 6 with constraint >=4.8.4 <6.1.0.
With the current configuration, users installing TypeScript 6.0.0 alongside this plugin will face an unmet peer dependency error and potential runtime failures.
Change @typescript-eslint/utils from ^8.48.0 to ^8.58.0 in the dependencies (line 61).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/eslint-plugin-query/package.json` at line 72, The package.json
currently pins `@typescript-eslint/utils` at ^8.48.0 which blocks TypeScript 6
support; update the dependency entry for "@typescript-eslint/utils" in
package.json to "^8.58.0" so its peerDependency range includes TypeScript 6
(>=4.8.4 <6.1.0), then run install/update lockfile to reflect the change (verify
package.json's dependencies object contains "@typescript-eslint/utils":
"^8.58.0").
Summary
The
@tanstack/eslint-plugin-querypackage currently declarestypescript: "^5.4.0"as a peer dependency. This causes package managers to report a peer dependency conflict when using TypeScript v6 (released as 6.0.2).The repo already includes a
typescript60devDependency alias and atest:types:ts60script confirming TS v6 compatibility is tested. The@typescript-eslint/utils@^8.48.0dependency also supports TS v6 (verified against its peerDependencies range>=4.8.4 <6.1.0in v8.58.0).This PR simply extends the peer dependency range to include
^6.0.0.Fixes #10357
✅ Checklist
Summary by CodeRabbit
Release Notes