feat(rimraf): add fs.rm migration recipe - #486
Open
Herrtian wants to merge 8 commits into
Open
Conversation
Member
|
thanks for being volunteering but you have 4 opened PRs we didn't have a lot of maintainer on this initiative so plz don't open any other pr. |
AugustinMauroy
requested changes
Jun 6, 2026
AugustinMauroy
left a comment
Member
There was a problem hiding this comment.
- give name to tests cases
- add remove dep step but before calling the function analyse the json ast to know if rimraf isn't used as cli
- add jsdocs to workflow
Contributor
Author
|
Thanks, understood. I won't open more PRs and will focus on the existing ones. I pushed the requested updates in the latest commit. |
Comment on lines
+221
to
+224
| const hasCallEdits = edits.length > 0; | ||
| if (!hasCallEdits) { | ||
| return null; | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| const hasCallEdits = edits.length > 0; | |
| if (!hasCallEdits) { | |
| return null; | |
| } | |
| if (!edits.length ) return null; |
avivkeller
reviewed
Aug 5, 2026
Comment on lines
+20
to
+25
| /** | ||
| * Escapes a binding name so it can be used safely in an ast-grep regex. | ||
| */ | ||
| const escapeRegex = (value: string) => | ||
| value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); | ||
|
|
avivkeller
reviewed
Aug 5, 2026
Comment on lines
+26
to
+27
| const getLineEnding = (source: string) => | ||
| source.includes('\r\n') ? '\r\n' : '\n'; |
Member
There was a problem hiding this comment.
IMO just use a \n, the users' formatter will handle it from there
avivkeller
reviewed
Aug 5, 2026
| */ | ||
| const parseImportBindings = (source: string): Binding[] => { | ||
| const bindings = parseNamedBindings(source); | ||
| const defaultMatch = source.match(/^import\s+([^,{]+?)(?:\s*,|\s+from\s+)/); |
avivkeller
reviewed
Aug 5, 2026
Comment on lines
+122
to
+125
| /** | ||
| * Builds the recursive rm options that match rimraf's common force behavior. | ||
| */ | ||
| const buildRmOptions = () => '{ recursive: true, force: true }'; |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #472.\n\n## Summary\n- add a rimraf-to-fs-rm recipe for literal rimraf deletes\n- handle v3 callback calls, v4/v5 promise calls, v5 sync calls, aliases, and sync glob expansion\n- document manual-review cases for runtime-specific rimraf behavior\n\n## Validation\n- npm.cmd run test --workspace @nodejs/rimraf-to-fs-rm\n- npm.cmd run type-check\n- npm.cmd run lint