Skip to content

Commit f6384c0

Browse files
committed
improvement(audits): ratchet knip unused exports, types, and duplicates
check:unused-exports runs knip once with the dead-code issue types gated at zero plus exports/types/duplicates compared against a shrink-only baseline of path#symbol entries. Package entry exports stay public surface via an explicit includeEntryExports: false. run-audits skips check:dead-code since this pass covers it.
1 parent f7b47bc commit f6384c0

5 files changed

Lines changed: 7186 additions & 2 deletions

File tree

‎knip.jsonc‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"$schema": "https://unpkg.com/knip@6/schema.json",
3-
// Gate reachability and dependency ownership. Export/type pruning needs review
4-
// of public package contracts and test-only consumers, not a blanket threshold.
3+
// Plain `knip` (check:dead-code) gates reachability and dependency ownership.
4+
// Unused exports, types, and duplicates are ratcheted by check:unused-exports,
5+
// which reuses this config in the same knip pass.
56
"include": ["files", "dependencies", "unlisted", "unresolved"],
7+
// Package `exports`/`main`/`bin` targets are entries; their exports are public
8+
// contracts (ts-sdk, emcn, cli, …), so knip must never report them as unused.
9+
"includeEntryExports": false,
610
"workspaces": {
711
".": {
812
"entry": ["scripts/**/*.{ts,tsx}", "vitest.shared.ts"],

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"check:desktop-bridge": "bun run scripts/check-desktop-bridge-contract.ts --check",
8282
"check:desktop-ipc": "bun run scripts/check-desktop-ipc-contract.ts",
8383
"check:route-verbs": "bun run scripts/check-route-verbs.ts",
84+
"check:unused-exports": "bun run scripts/check-unused-exports.ts",
8485
"desktop-bridge-contract:update": "bun run scripts/check-desktop-bridge-contract.ts --update",
8586
"mship-contracts:generate": "bun run scripts/sync-mothership-stream-contract.ts",
8687
"mship-contracts:check": "bun run scripts/sync-mothership-stream-contract.ts --check",

0 commit comments

Comments
 (0)