fix(arborist): don't checkEngine/checkPlatform for extraneous deps
Fixes #7622
The linked issue describes the problem in detail, I won't replicate that here.
@YodaDaCoda Are you able to add a test that would fail before the fix?
I have made an attempt... but it doesn't work how I expect it to. The test passes whether or not the fix is in place (i.e. it doesn't throw). I need help from someone more familiar with the codebase to figure out how to properly trigger the condition.
Strict mode throws. You can pass in the values and set strict to true. A good example is here
I worded that very poorly. It probably would throw, if the problematic dep wasn't being pruned. Not clear to me why it's pruned in the test, but not in Real Life. The package.json / package-lock.json probably need to be tweaked somehow.
It's the checkPlatform() method that I've experienced causing the error, not checkEngine(), so the engineStrict option doesn't help.
That example you've shared does help me clean up the test somewhat though, thanks.