Open isaacs opened 1 year ago
I don't think that's a safe option to take - vulns are quite often false positives, and while we can assume that the thing for which it's optional can work without it, we can't assume that the behavior of the application will remain unbroken if the optional dep isn't present.
If the application is depending on the optional dep, they should install it as a dependency, I'd think?
But yes, it would be a semver major change to npm for sure.
What i mean is, a package could have it as an optional dep, and removing that optional dep is a breaking change for the package, because it might break consumers of the package.
I am for this feature as well and would like to provide another use case.
A package made a minor upgrade, and introduced a security issue. Yu fill in a new issue on the package (or you send an email to keep it private), and still want your CI to pass, and you could ask npm audit
to just ignore the package until either the issue is fixed/you remove the package/you use another package/you stay on the version that have no security issue.
Motivation ("The Why")
Sometimes an optional transitive dependency may have a security advisory against it, and there may be no way to fix it.
For example:
Example
How
Current Behaviour
Desired Behavior
References