chore: add a tuned knip config and drop the unused @fast-check/vitest
Summary
Follow-up to #554: makes dead-code detection repeatable instead of a one-off manual audit. Raw knip output on this repo was untrustworthy — it flagged lib/index.ts itself as unused because nothing declared the entry points — which is exactly why #554 needed every finding hand-verified.
Stacked on #554 (
claude/audit-37-dead-code). Merge #554 first; this PR then shows only the config commit. (Theruntime/session-affinity.tsorphan this config surfaced was added to #554, where it belongs thematically.)
Changes
knip.json(new): declares the real entry points — the plugin-hostindex.ts, thelib/index.tsfacade, theauth/,request/,codex-cli/,ui/subpath index files that backpackage.jsonexports, thescripts/bins, and the test suites; ignoresbench/,vendor/,dist/,docs/; ignores the host-resolved@openai/codexpeer, the editor-onlytypescript-language-server, and the platform clipboard/locator binaries; downgrades export-level findings to warnings, so the blocking signal is unused files and dependencies only. With this config, knip exits clean on the current tree (94 unused-export warnings remain as an explicit pruning backlog rather than noise).@fast-check/vitestremoved from devDependencies: zero imports anywhere — the property/chaos suites importfast-checkdirectly, which stays. Bothpackage.jsonand the tab-indentedpackage-lock.jsonwere edited surgically; the lockfile diff is exactly the one removed entry (24 lines), no formatting churn.
Deliberately no npm script: knip is not a devDependency, and whether to add and pin it (this repo SHA-pins its CI actions) is a maintainer decision. Until then it runs via npx knip and picks the config up automatically.
Validation
- [x]
npx knipexits 0 with zero error-level findings on this tree - [x]
npm ci --dry-runvalidates the hand-edited lockfile - [x]
npm run typecheck; the fast-check property suite still passes (4/4)
Risk / Rollback
Tooling config + one unused devDependency; revert the single commit.
https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
Generated by Claude Code
note: greptile review for oc-chatgpt-multi-auth. cite files like lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.
Greptile Summary
this pr adds a knip.jsonc config that declares entry points and demotes export-level findings to warnings, and removes the @fast-check/vitest devDependency which has zero imports across the repo (property tests use fast-check directly).
knip.jsonc: pins entry points for the plugin-host, lib facade, subpath exports, scripts, and test suites; ignoresbench/,vendor/,dist/,docs/; lists platform-specific binaries (powershell.exe,pbcopy,where) and runtime-resolved deps (@openai/codex,typescript-language-server) explicitly; keepsfiles/dependenciesat error severity.@fast-check/vitestremoval: confirmed unused — all property and chaos test files import fromfast-checkdirectly; bothpackage.jsonandpackage-lock.jsonare updated surgically with no collateral formatting churn.
Confidence Score: 5/5
safe to merge — tooling config and one unused devDependency removal, no runtime code touched
the change is entirely in tooling config and lockfile; all declared entry points were verified to exist on disk; @fast-check/vitest has zero imports across the codebase; the lockfile diff is surgical with no collateral churn
no files require special attention
Important Files Changed
| Filename | Overview |
|---|---|
| knip.jsonc | new knip config — entry points verified against repo structure; ignoreBinaries covers windows/mac platform binaries; schema pinned to 6.16.1; no issues found |
| package.json | removes @fast-check/vitest from devDependencies — confirmed no imports anywhere in the codebase |
| package-lock.json | removes the single @fast-check/vitest lockfile entry (24 lines); no formatting churn; lockfile remains consistent |
Reviews (3): Last reviewed commit: "chore: convert the knip config to jsonc ..." | Re-trigger Greptile
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. Credits must be used to enable repository wide code reviews.
pr adds knip static analysis configuration to detect unused code and exports, and removes the now-unused Tooling and dependency updates 🎯 1 (Trivial) | ⏱️ ~3 minutes ✏️ Tip: You can configure your own custom pre-merge checks in the settings.📝 Walkthrough
Walkthrough
@fast-check/vitest plugin from dev dependencies.Changes
Layer / File(s)
Summary
Knip static analysis configuration
knip.jsonintroduces knip configuration targeting index.ts, lib/**, scripts, and test entry points. ignores bench/vendor/dist/docs directories and specific binary commands (powershell.exe, pbcopy, where). excludes typescript-language-server and
@openai/codex from analysis. sets exports, types, nsExports, nsTypes, duplicates, and enumMembers to warning level.
Remove unused vitest plugin
package.jsondeletes
@fast-check/vitest from devDependencies, suggesting the property-based testing framework is no longer integrated with vitest.Estimated code review effort
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name
Status
Explanation
Title check
✅ Passed
title follows conventional commits format (chore: summary), is 69 chars (<=72), uses lowercase imperative voice, and accurately describes both main changes: adding knip config and removing unused
@fast-check/vitest.
Docstring Coverage
✅ Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check
✅ Passed
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
✅ Passed
Check skipped because no linked issues were found for this pull request.
Description check
✅ Passed
pr description covers summary, changes, and validation checklist; however, it lacks the structured docs/governance and risk/rollback sections from the template.
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
claude/audit-38-knip-config✨ Simplify code
claude/audit-38-knip-config
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Closing as superseded — the substance of this stack is already on main:
knip.jsoncis present onmain(byte-identical to what #555 proposed).@fast-check/vitesthas already been removed fromdevDependencies.- The unused-export / unused-type backlog that #556 and #557 pruned is already clean on current
main(verified by running knip against today's tree — no unused files, no unused deps; only a handful of intentional warn-level export/type/enum keepers remain).
Because the bases were ~159 commits behind main, replaying the original deletions would risk removing code that has since become live, with no net benefit. The one genuinely still-valid finding from reviewing this stack — a broken dashboard-settings.js import in test/settings-preview.test.ts that knip surfaced — has been split out into #616. Thanks!