Skip to content

Commit

Permalink
fix(audit-level): add info audit level
Browse files Browse the repository at this point in the history
This is a valid level but wasn't configured to be allowed.

Also added this param to the usage output for `npm audit`
  • Loading branch information
wraithgar committed Mar 23, 2021
1 parent 581b60b commit 6dca5fa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return [
'audit-level',
'dry-run',
'force',
'json',
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ define('audit', {

define('audit-level', {
default: null,
type: ['low', 'moderate', 'high', 'critical', 'none', null],
type: ['info', 'low', 'moderate', 'high', 'critical', 'none', null],
description: `
The minimum level of vulnerability for \`npm audit\` to exit with
a non-zero exit code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ registry and all registries configured for scopes. See the documentation for
#### \`audit-level\`
* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null
The minimum level of vulnerability for \`npm audit\` to exit with a non-zero
exit code.
Expand Down
2 changes: 1 addition & 1 deletion tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ All commands:
npm audit [fix]
Options:
[--dry-run] [-f|--force] [--json] [--package-lock-only] [--production]
[--audit-level <info|low|moderate|high|critical|none>] [--dry-run] [-f|--force] [--json] [--package-lock-only] [--production]
Run "npm help audit" for more info
Expand Down

0 comments on commit 6dca5fa

Please sign in to comment.