severity
Every status code syncpack assigns has a default treatment: some can be auto-fixed and others are errors or warnings that need to be fixed manually. The optional severity map on a version group lets you override that behaviour for the dependencies the group matches.
{ "versionGroups": [ { "label": "Don't auto-delete banned dependencies, fail CI instead", "dependencies": ["lodash", "moment"], "isBanned": true, "severity": { "IsBanned": "error", }, }, { "label": "Override syncpack's refusal to rewrite .version", "dependencies": ["my-pkg"], "dependencyTypes": ["local"], "pinVersion": "1.0.0", "severity": { "RefuseToPinLocal": "fix", }, }, { "label": "Don't auto-fix missing catalog entries, warn instead", "policy": "catalog", "severity": { "MissingFromCatalog": "warn", }, }, ],}Possible Values
| Value | fix | lint |
|---|---|---|
"fix" | Fix, exit 0 | Display error, exit 1 |
"warn" | Display warning, exit 0 | Display warning, exit 0 |
"error" | Do not fix, display error, exit 1 | Display error, exit 1 |
Default Values
When a status has no explicit entry in the map, syncpack falls back to a default appropriate for its kind:
| Status Code Type | Configurable? | Default severity |
|---|---|---|
| Valid | no | n/a |
| Fixable | yes | "fix" |
| Unfixable | no | "error" |
| RefuseToPinLocal / RefuseToSnapLocal | yes | "warn" |
| Suspect | no | "warn" |
| Conflict (between version + semver groups) | no | "error" |
strict: true escalates every unconfigured Suspect default from "warn" to "error". It does not touch Fixable defaults, and explicit severity always wins: "RefuseToPinLocal": "warn" stays "warn" even under strict: true.
Excluded Values
A few status codes are deliberately not configurable:
DiffersToNpmRegistryis owned byupdateGroups. Registry-update behaviour is tuned there, not via severity. Writing it as a severity key fails withInvalidSeverityKey.- Unfixable and Conflict statuses are always
"error". They represent ambiguity that severity cannot resolve: syncpack has no fix to apply and silencing them would hide real problems.