feat: support auditLevel (#10554)

* feat: support `auditLevel`

* refactor: auditLevel

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
btea
2026-02-07 02:54:59 +08:00
committed by Zoltan Kochan
parent 22eaf9b50e
commit 7d8be9f1e9
4 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
---
"@pnpm/plugin-commands-audit": minor
"@pnpm/config": minor
"pnpm": minor
---
Support configuring `auditLevel` in the `pnpm-workspace.yaml` file [#10540](https://github.com/pnpm/pnpm/issues/10540).

View File

@@ -238,6 +238,7 @@ export interface Config extends OptionsFromRootManifest {
trustPolicy?: TrustPolicy
trustPolicyExclude?: string[]
trustPolicyIgnoreAfter?: number
auditLevel?: 'low' | 'moderate' | 'high' | 'critical'
}
export interface ConfigWithDeprecatedSettings extends Config {

View File

@@ -142,4 +142,5 @@ export const types = Object.assign({
cpu: [String, Array],
libc: [String, Array],
os: [String, Array],
'audit-level': ['low', 'moderate', 'high', 'critical'],
}, npmTypes.types)

View File

@@ -125,7 +125,6 @@ export function help (): string {
}
export type AuditOptions = Pick<UniversalOptions, 'dir'> & {
auditLevel?: 'low' | 'moderate' | 'high' | 'critical'
fix?: boolean
ignoreRegistryErrors?: boolean
json?: boolean
@@ -134,6 +133,7 @@ export type AuditOptions = Pick<UniversalOptions, 'dir'> & {
ignore?: string[]
ignoreUnfixable?: boolean
} & Pick<Config, 'auditConfig'
| 'auditLevel'
| 'ca'
| 'cert'
| 'httpProxy'