diff options
author | nlf <quitlahok@gmail.com> | 2021-04-15 20:35:51 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2021-04-22 16:49:46 +0300 |
commit | 42ca59eeedd3e402aa1c606941f7f52864e6039b (patch) | |
tree | 48850769adba5ada1828f8c7309c5b28a8063ebc /lib | |
parent | a4e7f4e4b40d645fed97622a97c7fa72aa5da82b (diff) |
fix(ls): do not exit with error when all problems are extraneous deps
PR-URL: https://github.com/npm/cli/pull/3086
Credit: @nlf
Close: #3086
Reviewed-by: @wraithgar, @ruyadorno
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ls.js | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -166,7 +166,10 @@ class LS extends BaseCommand { ) } - if (problems.size) { + const shouldThrow = problems.size && + ![...problems].every(problem => problem.startsWith('extraneous:')) + + if (shouldThrow) { throw Object.assign( new Error([...problems].join(EOL)), { code: 'ELSPROBLEMS' } |