You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The same miss happened with constructor parameters and with namespace imports (fs.rm with a parameter named fs). The shadow walk climbed out through the Parameter node, so functionLikeDeclares counted the parameter's own name. JavaScript evaluates parameter decorators in the scope around the method. The fix makes the walk skip the method's parameter and body scopes when it leaves a parameter decorator. The new test cases failed on main ([] instead of lines 3 and 4) and pass with the fix.
var hoisting: no false negative, tests only
The gate treats a var as block-scoped. It only counts a var as hiding the import when the var statement sits in a block that encloses the call. A var's real scope is the nearest function, static block, or module, and that scope always contains the declaring block. So any call the gate treats as hidden really is hidden, and a var can only cause extra flags. The ponytail: comment is accurate. A new test pins the cases that must still be flagged: a nested-block var in a sibling function, in the body of a function whose parameter default calls rm, and in a class static block.
Checks
Run on a tree that contains origin/mainff7421ba8b (tree 89ba465606, identical to this PR's head):
Independent review by change-risk-reviewer (Claude Opus 5.5) found no material findings. It confirmed the jump can only remove shadowing, so it can't create a new miss, and found no var counterexample.
No changeset: only root scripts/ and packages/agent-bundle/tests/** change, and both are exempt per .changeset/README.md.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #825, covering the two should-fix gaps from its independent verification of the
scripts/check-test-remove-tree.mjslint gate.Parameter decorator false negative: reproduced and fixed
On
origin/main, an importedrmcalled inside a parameter decorator was missed when the parameter itself was namedrm:The same miss happened with constructor parameters and with namespace imports (
fs.rmwith a parameter namedfs). The shadow walk climbed out through theParameternode, sofunctionLikeDeclarescounted the parameter's own name. JavaScript evaluates parameter decorators in the scope around the method. The fix makes the walk skip the method's parameter and body scopes when it leaves a parameter decorator. The new test cases failed on main ([]instead of lines 3 and 4) and pass with the fix.varhoisting: no false negative, tests onlyThe gate treats a
varas block-scoped. It only counts avaras hiding the import when thevarstatement sits in a block that encloses the call. Avar's real scope is the nearest function, static block, or module, and that scope always contains the declaring block. So any call the gate treats as hidden really is hidden, and avarcan only cause extra flags. Theponytail:comment is accurate. A new test pins the cases that must still be flagged: a nested-blockvarin a sibling function, in the body of a function whose parameter default callsrm, and in a class static block.Checks
Run on a tree that contains
origin/mainff7421ba8b(tree89ba465606, identical to this PR's head):pnpm build: exit 0pnpm typecheck: exit 0pnpm lint(includes the gate): exit 0pnpm test:unit: 4432 passed, 0 failed, 6 skippedrstest packages/agent-bundle/tests/check-test-remove-tree.test.ts: 17/17Independent review by change-risk-reviewer (Claude Opus 5.5) found no material findings. It confirmed the jump can only remove shadowing, so it can't create a new miss, and found no
varcounterexample.No changeset: only root
scripts/andpackages/agent-bundle/tests/**change, and both are exempt per.changeset/README.md.