Prerequisites
Reproduction url
https://github.com/WooWan/knip-workspace-reproduction
Reproduction access
Description of the issue
Knip fails to discover a workspace that is explicitly included after a negated workspace pattern.
Reproduction repo:
https://github.com/WooWan/knip-workspace-reproduction
pnpm install
pnpm knip:reproduction
The repro uses:
packages:
- "!packages/*"
- "packages/should-include"
and:
"knip:reproduction": "knip --workspace packages/should-include"
Expected: Knip should discover and analyze packages/should-include.
Actual: Knip does not treat packages/should-include as an available workspace, so it cannot be selected with --workspace.
It looks like Knip separates negated workspace patterns and applies them as global ignore patterns. Because of that, later positive patterns cannot include workspaces again.
Expected behavior: Knip should preserve workspace pattern ordering/re-inclusion semantics where supported by the package manager, or clearly report that this pattern shape is unsupported.
Prerequisites
Reproduction url
https://github.com/WooWan/knip-workspace-reproduction
Reproduction access
Description of the issue
Knip fails to discover a workspace that is explicitly included after a negated workspace pattern.
Reproduction repo:
https://github.com/WooWan/knip-workspace-reproduction
The repro uses:
and:
Expected: Knip should discover and analyze
packages/should-include.Actual: Knip does not treat
packages/should-includeas an available workspace, so it cannot be selected with--workspace.It looks like Knip separates negated workspace patterns and applies them as global ignore patterns. Because of that, later positive patterns cannot include workspaces again.
Expected behavior: Knip should preserve workspace pattern ordering/re-inclusion semantics where supported by the package manager, or clearly report that this pattern shape is unsupported.