danger / danger-js

⚠️ Stop saying "you forgot to …" in code review
http://danger.systems/js/
MIT License
5.29k stars 368 forks source link

Fix the shouldUseGitHubOverride logic for ESM imports #1430

Closed mgol closed 7 months ago

mgol commented 8 months ago

The shouldUseGitHubOverride util is called with Module._load parameters. So far, it assumed it will get a string request and a NodeModule parent parameters. However, for ESM imports parent is actually undefined.

Account for this in code by making parent an optional argument; add a test.

Fixes gh-1421

cc @fbartho