Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/eslint-plugin-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"npm-run-all2": "^5.0.0"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": "^5.0.0"
Comment on lines 71 to 73
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for deprecated context/SourceCode members removed in ESLint v10

echo "=== Checking for deprecated context.parserOptions ==="
rg -n "context\.parserOptions" --type ts packages/eslint-plugin-query/

echo "=== Checking for deprecated context.parserPath ==="
rg -n "context\.parserPath" --type ts packages/eslint-plugin-query/

echo "=== Checking for deprecated context.getScope ==="
rg -n "context\.getScope\b" --type ts packages/eslint-plugin-query/

echo "=== Checking for deprecated context.getCwd ==="
rg -n "context\.getCwd\b" --type ts packages/eslint-plugin-query/

echo "=== Checking for deprecated RuleTester 'type' property in test errors ==="
rg -n "type:\s*['\"]" --type ts packages/eslint-plugin-query/ | grep -i "test\|spec\|error"

Repository: TanStack/query

Length of output: 415


🏁 Script executed:

cat -n packages/eslint-plugin-query/src/utils/ast-utils.ts | sed -n '280,310p'

Repository: TanStack/query

Length of output: 1385


🏁 Script executed:

# Check for any other potential deprecated API usages in rule files
echo "=== Checking rule implementations ==="
rg -n "context\.(parserOptions|parserPath|getScope|getCwd|getSourceCode)" --type ts packages/eslint-plugin-query/src/rules/

Repository: TanStack/query

Length of output: 262


🏁 Script executed:

cat -n packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts | sed -n '65,85p'

Repository: TanStack/query

Length of output: 972


Remove backwards compatibility fallbacks for ESLint < 8.37.0.

The plugin references deprecated APIs context.getSourceCode() and context.getScope() (removed in ESLint v10) as fallbacks in:

  • packages/eslint-plugin-query/src/utils/ast-utils.ts:292
  • packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts:73

While these fallbacks won't execute in ESLint v8.57.0+ (the minimum supported version), they contain references to removed APIs. Since the plugin's minimum version is already well above 8.37.0, these fallback paths are unnecessary and should be removed to avoid potential type errors with ESLint v10's type definitions.

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/eslint-plugin-query/package.json` around lines 71 - 73, Remove the
legacy fallback branches that call the deprecated ESLint APIs
context.getSourceCode() and context.getScope() in the two modules (ast-utils.ts
and stable-query-client.rule.ts); delete the conditional/alternative paths that
reference those APIs and leave only the modern code path that assumes ESLint >=
8.57.0, ensuring no remaining references to getSourceCode() or getScope() exist
(search for those symbol names and remove their fallback usages in the functions
around the previously noted locations).

},
"peerDependenciesMeta": {
Expand Down