diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index b0f365f293dfc..b2e8baf014977 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for #### `audit-level` * Default: null -* Type: "info", "low", "moderate", "high", "critical", "none", or null +* Type: null, "info", "low", "moderate", "high", "critical", or "none" The minimum level of vulnerability for `npm audit` to exit with a non-zero exit code. diff --git a/lib/utils/config/definition.js b/lib/utils/config/definition.js index e7c605fb7e308..5ec2ba1ab1d58 100644 --- a/lib/utils/config/definition.js +++ b/lib/utils/config/definition.js @@ -116,13 +116,14 @@ const describeUsage = (def) => { description = def.hint } - if (multiple) - description = `${description} [${description} ...]` - if (bool) key = `${key}|${key}` - return `${key} ${description}` + const usage = `${key} ${description}` + if (multiple) + return `${usage} [${usage} ...]` + else + return usage } const describeType = type => { diff --git a/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js b/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js index 152f1f7c71598..a0b8d1999d4b7 100644 --- a/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js +++ b/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js @@ -335,7 +335,7 @@ All commands: npm docs [ [ ...]] Options: - [--browser|--browser ] [-w|--workspace [ ...]] [-ws|--workspaces] + [--browser|--browser ] [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] alias: home @@ -370,7 +370,7 @@ All commands: npm exec --package=foo -c ' [args...]' Options: - [-w|--workspace [ ...]] [-ws|--workspaces] + [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] alias: x @@ -702,7 +702,7 @@ All commands: npm repo [ [ ...]] Options: - [--browser|--browser ] [-w|--workspace [ ...]] [-ws|--workspaces] + [--browser|--browser ] [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] Run "npm help repo" for more info @@ -735,7 +735,7 @@ All commands: npm run-script [-- ] Options: - [-w|--workspace [ ...]] [-ws|--workspaces] + [-w|--workspace [-w|--workspace ...]] [-ws|--workspaces] aliases: run, rum, urn @@ -772,7 +772,7 @@ All commands: npm set-script [