Repository navigation
refactor(eslint-plugin-query): remove the 'eslint < 8.37.0' fallbacks for 'sourceCode' and 'getScope' since the peer range starts at 8.57.0 - #12325
Conversation
… for 'sourceCode' and 'getScope' since the peer range starts at 8.57.0
|
|
View your CI Pipeline Execution ↗ for commit 6cd4504
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview5 package(s) bumped directly, 19 bumped as dependents. 🟨 Minor bumps
🟩 Patch bumps
|
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Use context.sourceCode directly packages/eslint-plugin-query/src/utils/ast-utils.ts, packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts |
The AST utility obtains scope through context.sourceCode.getScope(node). The fixer reads expression text from context.sourceCode. Both changes remove fallbacks to older ESLint APIs. |
Priority:
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Refactor
Suggested reviewers: dogpawhat
Merge Risk: 
Minimal · up to 4760f
-
The source-access update is compatible with all supported ESLint versions and does not introduce an actionable merge risk.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · 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.
Comment @coderabbitai help to get the list of available commands.
size-limit report 📦
|
🎯 Changes
stable-query-clientandASTUtils.getReferencedExpressionByIdentifierkept fallbacks for ESLint < 8.37.0 (context.getSourceCode()andcontext.getScope()), each behind anoxlint-disable-next-line typescript/no-unnecessary-conditioncomment. Theeslintpeer range starts at 8.57.0, wherecontext.sourceCodeandsourceCode.getScope()always exist, so the fallbacks never run. The other rules in this package already usecontext.sourceCodedirectly.Use
context.sourceCodeandcontext.sourceCode.getScope(node)directly, and remove the fallbacks with their comments.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit