Skip to content

Conversation

0xlakshan
Copy link
Contributor

Fixes #167

As shown in the screenshot below, when a call_expression AST node is wrapped in an expression_statement , which occurs in require scenarios like require('module').property the getNodeRequireCalls utility fails to detect it.

I’ve updated the utility to handle these cases.

Screenshot from 2025-08-12 02-14-04

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add more test cases to handle that 😁

@0xlakshan
Copy link
Contributor Author

🧪 tests are WIP

@AugustinMauroy
Copy link
Member

👌🏻

@0xlakshan 0xlakshan marked this pull request as ready for review August 12, 2025 01:29
Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@AugustinMauroy AugustinMauroy requested a review from a team August 12, 2025 15:09
@alexbit-codemod
Copy link
Contributor

awesome work @0xlakshan!
cant wait to see this merged.

@avivkeller avivkeller merged commit e7d43ce into nodejs:main Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: require('module').property pattern not detected by getNodeRequireCalls utility function
5 participants