Skip to content

💡 Report stale workspaces configuration keys as configuration hints #1801

Description

@WooWan

Suggest an idea for Knip

Description

knip.json can retain workspace-specific config keys after a workspace is removed or renamed. Knip already hints at stale ignoreWorkspaces entries, but stale workspaces keys go unreported.

{
  "workspaces": {
    "packages/a": {},
    "services/stale": {}
  }
}

If services/stale no longer matches any discovered workspace, it stays silent during a normal run.

Use case

In a large monorepo, services are added, renamed, and removed regularly, so workspaces overrides (ignoreDependencies, entry, project, plugins) easily go stale. They're hard to spot manually and make config cleanup harder after service lifecycle changes.

Proposed behavior

Emit a configuration hint for workspaces keys that match no discovered workspace:

Configuration hints
services/stale  knip.json  Remove from workspaces

For glob keys, report only when the key matches no workspace at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions