danger / danger-js

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

Fix the shouldUseGitHubOverride logic for ESM imports #1430

Closed mgol closed 5 months ago

mgol commented 6 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