feat(DEP0197): migrate util.types.isNativeError → Error.isError#157
Merged
brunocroh merged 14 commits intonodejs:mainfrom Sep 7, 2025
Merged
feat(DEP0197): migrate util.types.isNativeError → Error.isError#157brunocroh merged 14 commits intonodejs:mainfrom
util.types.isNativeError → Error.isError#157brunocroh merged 14 commits intonodejs:mainfrom
Conversation
c288f36 to
ddce49b
Compare
ddce49b to
d519ac2
Compare
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
avivkeller
reviewed
Aug 12, 2025
Member
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Looks pretty good. I think the if … return A else return A might be a mistake?
Annnd broken record: dynamic imports
Comment on lines
51
to
65
| if (!propertyAccess) { | ||
| return { | ||
| path, | ||
| propertyAccess, | ||
| lastPropertyAccess, | ||
| depth: pathArr.length, | ||
| }; | ||
| } | ||
|
|
||
| return { | ||
| path, | ||
| propertyAccess, | ||
| lastPropertyAccess, | ||
| depth: pathArr.length, | ||
| }; |
Member
There was a problem hiding this comment.
These are the same O.o
|
|
||
| if (nodes.length === nodesToEdit.length) { | ||
| const result = removeBinding( | ||
| // @ts-ignore - ast-grep types are not fully compatible with JSSG types |
Member
There was a problem hiding this comment.
Suggested change
| // @ts-ignore - ast-grep types are not fully compatible with JSSG types | |
| // @ts-expect-error - ast-grep types are not fully compatible with JSSG types |
Member
Author
There was a problem hiding this comment.
Isn't necessary any more, so removed
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Member
Author
All done |
util.types.isNativeError → Error.isError
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.
Closes #113
This PR depends on PR #151 being merged first.
Overview
This PR introduces a new TypeScript transformation that automatically migrates deprecated
util.types.isNativeErrorusage to the modernError.isErrorAPI.Additional work
This implements one additional case for
utils/src/ast-grep/remove-binding.ts. Previously, it failed to remove deep named imports, so I fixed this behaviour and added a new test to prevent regressionPrevious behaviour:
input
result
New behaviour:
input
result