Skip to content
Fallow home
All docs pages

Docs home

Unused dependency overrides

What an unused-dependency-override finding of fallow dead-code means, why it matters and how to fix it.

What it reports

Package-manager override target is not declared or resolved.

Dependencies explains how fallow finds it.

Why it matters

An entry in pnpm-workspace.yaml's overrides: section (skipped when packageManager names a pnpm version that ignores it: pnpm before 10.5.1, or pnpm 10 or earlier when the root package.json declares non-empty pnpm.overrides or resolutions), package.json#pnpm.overrides (skipped when packageManager names pnpm 11 or later, which does not read it), npm or Bun's top-level package.json#overrides, or Bun's package.json#resolutions whose target package is not declared by any workspace package and is not present in the active readable lockfile (pnpm-lock.yaml, package-lock.json, npm-shrinkwrap.json, or bun.lock). Override entries linger after their target package leaves the resolved dependency tree. pnpm and npm projects without a readable lockfile fall back to workspace package manifests and keep a hint so transitive CVE pins can be reviewed before removal. Bun projects with only binary bun.lockb fail closed: fallow reports a workspace diagnostic and emits no unused-override finding until a readable bun.lock exists. To fix: delete the entry, refresh the active lockfile if it is stale, or add the entry to ignoreDependencyOverrides when the override is intentionally retained. See also: fallow/misconfigured-dependency-override.

Example

The root package.json declares overrides: { axios: ^1.6.0 }, but no workspace package.json declares axios and the active lockfile does not resolve it.

Fix

Delete the entry from its reported declaration source. If the finding is caused by a stale or missing readable lockfile, refresh the active lockfile and rerun fallow. If the override is intentionally retained, add it to ignoreDependencyOverrides in your fallow config.

Facts

FactValue
Issue typeunused-dependency-override
Rule id in SARIF outputfallow/unused-dependency-override
Commandfallow dead-code
Default severitywarn
Config key in rulesunused-dependency-overrides
Filter option--unused-dependency-overrides
Fixable with fallow fixNo
Opt-inNo

When to keep the code

  • An override that pins a version of a transitive dependency, for example for a security fix, is used when the lockfile holds that package. Fallow does not report it.
  • Without a lockfile, fallow checks only the package.json files, and the finding has a hint. Check the transitive pins before you remove them.
  • To keep an override on purpose, add it to ignoreDependencyOverrides.

Notes

Override sources and the pnpm version tells which sources fallow reads for each pnpm version.