Skip to main content

SKY-Q411 · Quality, structure and performance

Unused pnpm catalog entry

Low

A pnpm-workspace.yaml catalog entry is not referenced by any package.json in the workspace. Neither the default catalog nor a named catalog is used through the catalog protocol for that package.

Languages
pnpm-workspace.yaml, package.json
Turned on by
skylos . --quality
Quality gate
counted toward the gate limits (full and diff scans). Reported as quality; counts toward max_quality.
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

Stale catalog entries look like supported versions that nobody installs. They mislead upgrades and reviews and keep pinning a package the workspace no longer uses.

What Skylos flags

pnpm-workspace.yaml · YAMLReported on line 5
packages:  - "."catalog:  lodash: ^4.17.21  left-pad: ^1.3.0
package.json · JSON
{"name":"shop","private":true,"dependencies":{"lodash":"catalog:"}}
src/app.js · JavaScript
import _ from "lodash";console.log(_);

What Skylos leaves alone

pnpm-workspace.yaml · YAML
packages:  - "."catalog:  lodash: ^4.17.21

package.json: same as in the flagged example.

src/app.js: same as in the flagged example.

Why Skylos leaves it alone

Every catalog entry is referenced with the catalog protocol by a workspace package.

How Skylos decides

  1. Reads catalog and catalogs from each pnpm-workspace.yaml as data, with YAML 1.2 scalars, and never runs pnpm or a pnpmfile hook.
  2. Collects catalog references from every package.json under the workspace root (dependency maps, resolutions, overrides, pnpm.overrides and catalog references in scripts) plus the workspace file's own overrides. Folders the dependency scan skips are still searched.
  3. Reports LOW at the entry line only when that inventory is complete. An unreadable manifest, a pnpmfile hook, a competing bun or Yarn catalog source, or an unparsed reference holds back every unused-entry claim and is recorded in analysis_summary.npm_dependency_analysis.catalog_analysis.

How to fix it

Remove the unused entry, or reference it from the workspace package that needs it.

pnpm-workspace.yaml · YAML · the fix, against the flagged file
packages:  - "."catalog:  lodash: ^4.17.21Removed:   left-pad: ^1.3.0

When it can be wrong

  • A catalog entry kept for an upcoming package or a published template is reported until a package.json references it.
  • Tools that rewrite manifests outside pnpm hooks are not modelled.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • Set [tool.skylos] ignore = ["SKY-Q411"] to disable this rule project-wide.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.