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`

PR-URL: #2923
Credit: @wraithgar
Close: #2923
Reviewed-by: @ruyadorno
  • Loading branch information
wraithgar committed Mar 24, 2021
1 parent 0379eab commit 98efade
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
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
Expand Up @@ -220,7 +220,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
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
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 98efade

Please sign in to comment.