Skip to content

Don't disable configuration hints in workspace-scoped runs#1791

Merged
webpro merged 3 commits into
webpro-nl:mainfrom
WooWan:fix/workspace-config-hints
Jun 17, 2026
Merged

Don't disable configuration hints in workspace-scoped runs#1791
webpro merged 3 commits into
webpro-nl:mainfrom
WooWan:fix/workspace-config-hints

Conversation

@WooWan

@WooWan WooWan commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

--workspace unconditionally disables configuration hints:

// src/util/create-options.ts
isDisableConfigHints: args['no-config-hints'] || isProduction || Boolean(workspace),

So --treat-config-hints-as-errors is a silent no-op in workspace-scoped runs — in monorepo CI that lints only changed workspaces, stale ignoreDependencies entries can never fail CI.

This PR filters hints to the selected workspaces instead of disabling them, mirroring how issues are filtered. Hints without a workspaceName are treated as root workspace hints.

--no-config-hints and production mode are unchanged. Tests added in test/workspaces/config-hints.test.ts.

@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/knip@1791
npm i https://pkg.pr.new/@knip/language-server@1791
npm i https://pkg.pr.new/@knip/mcp@1791

commit: b90b4c4

@webpro webpro force-pushed the fix/workspace-config-hints branch from d0df127 to b90b4c4 Compare June 17, 2026 07:32
@webpro

webpro commented Jun 17, 2026

Copy link
Copy Markdown
Member

Thanks for the PR. I deliberately gated this, because it might lead to confusion as ancestor + dependent workspaces of the selected ones are also included.

Made an adjustment to your branch to resolve conflict and --workspace . still returns no hints (guarding against false positives, unwanted results in CI). WDYT?

@changwan-wu

Copy link
Copy Markdown
Contributor

Thanks for the adjustment.

Since the common CI use case in monorepos is checking individual package/service workspaces, excluding root/top-level hints from workspace-scoped runs makes sense to me!

@webpro

webpro commented Jun 17, 2026

Copy link
Copy Markdown
Member

Thanks for the feedback, glad you agree. Let's go 🚀

@webpro webpro merged commit 8ce1ec8 into webpro-nl:main Jun 17, 2026
29 of 30 checks passed
@webpro

webpro commented Jun 17, 2026

Copy link
Copy Markdown
Member

🚀 This pull request is included in v6.17.2. See Release 6.17.2 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 --workspace disables configuration hints and makes --treat-config-hints-as-errors a silent no-op

3 participants