mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
Classify only a native addon refusal as one
The computed createRequire note main added ('…, such as a native addon,
ends the program') matched the native-addon pattern, so every package with
a computed require became a runtime island; it is a deferred gap now, like
other fences that may never run.
This commit is contained in:
@@ -25,7 +25,7 @@ const MESSAGE_REASONS: { code: string; pattern: RegExp; reason: string }[] = [
|
||||
pattern: /createRequire's require with this argument shape/,
|
||||
reason: "dynamic-require",
|
||||
},
|
||||
{ code: "SC2020", pattern: /native addon/, reason: "native-addon" },
|
||||
{ code: "SC2020", pattern: /^native addon /, reason: "native-addon" },
|
||||
{
|
||||
code: "SC2020",
|
||||
pattern: /through require\.cache|require\.extensions|Module\._|module\.register/,
|
||||
|
||||
Reference in New Issue
Block a user