fix(noShadow): detect destructured patterns in sibling scopes#9344
fix(noShadow): detect destructured patterns in sibling scopes#9344
Conversation
🦋 Changeset detectedLatest commit: ea58a38 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughThis PR fixes the nursery noShadow linter to correctly recognise destructured bindings (object, array, nested patterns and rest elements) as declarations in sibling scopes. The rule implementation now uses Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/skills/testing-codegen/SKILL.md:
- Around line 146-148: The table separator row currently lacks the required
spacing and is tripping MD060; update the table so the separator uses spaced
columns (e.g., change the separator from "|---|---|" to "| --- | --- |") and
ensure there is a blank line immediately before the table; specifically edit the
header/separator for the `biome_js_analyze` row (the line containing the
languages/extensions list) so the pipes have surrounding spaces and the
separator uses at least three dashes per column.
- Around line 172-175: The tree example contradicts the naming rule: update the
example so folder name and expected diagnostics align with the rule referenced
near lines 164-165; either rename validResolutionReact/ to a name that implies
diagnostics (e.g., invalidResolutionReact/) or change the inline comments so
file.js is marked "should not generate diagnostics" and file2.js "should
generate diagnostics" to match the stated naming convention; adjust only the
folder name or the per-file "should generate diagnostics" annotations in the
block containing validResolutionReact/, file.js, and file2.js to restore
consistency.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cf8e61ae-2324-4fe6-a664-cb5a574f9919
⛔ Files ignored due to path filters (2)
crates/biome_js_analyze/tests/specs/nursery/noShadow/invalidDestructuring.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noShadow/validDestructuring.js.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (5)
.changeset/fix-no-shadow-destructuring.md.claude/skills/testing-codegen/SKILL.mdcrates/biome_js_analyze/src/lint/nursery/no_shadow.rscrates/biome_js_analyze/tests/specs/nursery/noShadow/invalidDestructuring.jscrates/biome_js_analyze/tests/specs/nursery/noShadow/validDestructuring.js
Merging this PR will not alter performance
Comparing Footnotes
|
84a9ecf to
ea58a38
Compare
Summary
I used an AI agent for this fix, and I reviewed the code.
Closes #6921
The rule didn't handle destructuring at all.
Test Plan
Added new tests
Docs