Skip to content

Commit 6dca5fa

Browse files
committed
fix(audit-level): add info audit level
This is a valid level but wasn't configured to be allowed. Also added this param to the usage output for `npm audit`
1 parent 581b60b commit 6dca5fa

4 files changed

+4
-3
lines changed

lib/audit.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
1818
/* istanbul ignore next - see test/lib/load-all-commands.js */
1919
static get params () {
2020
return [
21+
'audit-level',
2122
'dry-run',
2223
'force',
2324
'json',

lib/utils/config/definitions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ define('audit', {
198198

199199
define('audit-level', {
200200
default: null,
201-
type: ['low', 'moderate', 'high', 'critical', 'none', null],
201+
type: ['info', 'low', 'moderate', 'high', 'critical', 'none', null],
202202
description: `
203203
The minimum level of vulnerability for \`npm audit\` to exit with
204204
a non-zero exit code.

tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ registry and all registries configured for scopes. See the documentation for
6464
#### \`audit-level\`
6565
6666
* Default: null
67-
* Type: "low", "moderate", "high", "critical", "none", or null
67+
* Type: "info", "low", "moderate", "high", "critical", "none", or null
6868
6969
The minimum level of vulnerability for \`npm audit\` to exit with a non-zero
7070
exit code.

tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ All commands:
204204
npm audit [fix]
205205
206206
Options:
207-
[--dry-run] [-f|--force] [--json] [--package-lock-only] [--production]
207+
[--audit-level <info|low|moderate|high|critical|none>] [--dry-run] [-f|--force] [--json] [--package-lock-only] [--production]
208208
209209
Run "npm help audit" for more info
210210

0 commit comments

Comments
 (0)