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
Follow-up to #825 and #846. The scripts/check-test-remove-tree.mjs lint gate missed recursive removals whose options object had a non-null assertion, such as rm(root, { recursive: true }!). The cause was that unwrapExpression stopped at the NonNullExpression, so optionsFlags never reached the object literal. Trunk had the same miss.
Wrappers
unwrapExpression now also unwraps:
Non-null assertions ({...}!). This fixes the reported miss for named rm, namespace fs.rm, and promises as fsp + fsp.rm. It also fixes the nested forms ({...} as const)!, {...}! satisfies O, and <O>{...}!.
Instantiation expressions (({...})<O>). The parser produces these, but TypeScript rejects them on an object literal (TS2635). The review flagged them as the only remaining wrapper, so they're covered for completeness.
Parentheses, as, satisfies, and <T>x were already handled. PartiallyEmittedExpression only comes from transformers and never from createSourceFile. A JSDoc @type cast in .js parses as a plain parenthesized expression, which was already handled.
A maxRetries inside a wrapped literal still counts as retried. Both new cases failed before the script change.
Out of scope, known gap
Wrappers on the callee are still missed by isNodeBoundRmCall: (rm)(...), rm!(...), and fs!.rm(...). So is fs.promises.rm on a default node:fs import.
Checks
Run on the merged head 41e0842bf6, which contains origin/mainc42b93d043:
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 and #846. The
scripts/check-test-remove-tree.mjslint gate missed recursive removals whose options object had a non-null assertion, such asrm(root, { recursive: true }!). The cause was thatunwrapExpressionstopped at theNonNullExpression, sooptionsFlagsnever reached the object literal. Trunk had the same miss.Wrappers
unwrapExpressionnow also unwraps:{...}!). This fixes the reported miss for namedrm, namespacefs.rm, andpromises as fsp+fsp.rm. It also fixes the nested forms({...} as const)!,{...}! satisfies O, and<O>{...}!.({...})<O>). The parser produces these, but TypeScript rejects them on an object literal (TS2635). The review flagged them as the only remaining wrapper, so they're covered for completeness.Parentheses,
as,satisfies, and<T>xwere already handled.PartiallyEmittedExpressiononly comes from transformers and never fromcreateSourceFile. A JSDoc@typecast in.jsparses as a plain parenthesized expression, which was already handled.A
maxRetriesinside a wrapped literal still counts as retried. Both new cases failed before the script change.Out of scope, known gap
Wrappers on the callee are still missed by
isNodeBoundRmCall:(rm)(...),rm!(...), andfs!.rm(...). So isfs.promises.rmon a defaultnode:fsimport.Checks
Run on the merged head
41e0842bf6, which containsorigin/mainc42b93d043: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: 18/18Independent review by change-risk-reviewer (Claude Opus 5.5) found no material findings. Its one nit, instantiation expressions, is fixed in this PR.
No changeset: only root
scripts/andpackages/agent-bundle/tests/**change, and both are exempt per.changeset/README.md.