lirantal / lockfile-lint

Lint an npm or yarn lockfile to analyze and detect security issues
Apache License 2.0
781 stars 35 forks source link

Add npm-shrinkwrap.json usage #73

Closed drazisil closed 4 years ago

drazisil commented 4 years ago

Description

Types of changes

Related Issue

None

Motivation and Context

Prevents users from hitting this error:

ABORTING lockfile lint process due to error exceptions 

Unable to find relevant lockfile parser for "npm-shrinkwrap.json", consider passing the --type option. 

Error
    at new ParsingError (/home/drazisil/.npm/_npx/12990/lib/node_modules/lockfile-lint/node_modules/lockfile-lint-api/src/common/ParsingError.js:27:33)
    at ParseLockfile.parseSync (/home/drazisil/.npm/_npx/12990/lib/node_modules/lockfile-lint/node_modules/lockfile-lint-api/src/ParseLockfile.js:53:13)
    at ValidateHostManager (/home/drazisil/.npm/_npx/12990/lib/node_modules/lockfile-lint/src/validators/index.js:40:27)
    at validators.forEach.validator (/home/drazisil/.npm/_npx/12990/lib/node_modules/lockfile-lint/src/main.js:35:28)
    at Array.forEach (<anonymous>)
    at Object.runValidators (/home/drazisil/.npm/_npx/12990/lib/node_modules/lockfile-lint/src/main.js:25:14)
    at Object.<anonymous> (/home/drazisil/.npm/_npx/12990/lib/node_modules/lockfile-lint/bin/lockfile-lint.js:31:17)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32) 

error: command failed with exit code 1 

How Has This Been Tested?

Confirmed the error does not occur when passing the --type flag

Screenshots (if appropriate):

Checklist:

image Photo Credit: https://unsplash.com/photos/YyEotvsoOXs

codecov-io commented 4 years ago

Codecov Report

Merging #73 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #73   +/-   ##
=======================================
  Coverage   95.08%   95.08%           
=======================================
  Files          11       11           
  Lines         183      183           
  Branches       29       29           
=======================================
  Hits          174      174           
  Misses          8        8           
  Partials        1        1

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3e894df...34c8b59. Read the comment docs.

lirantal commented 4 years ago

Thanks a bunch @drazisil ❤️ Minor typo correction and we'll land this in

drazisil commented 4 years ago

Minor typo correction and we'll land this in

What typo correction?

lirantal commented 4 years ago

What typo correction?

Silly me. Forgot to submit the review. See now.