Skip to content

Commit ca7717c

Browse files
committed
fix(audits): gate every knip issue type and exclude generated contracts from the export ratchet
knip's dependencies include also reports optionalPeerDependencies, which the strict list dropped. Gate every non-ratchet issue key so a new type fails closed. Generated contract files are excluded via ignoreIssues so rerunning their generators cannot trip the ratchet (359 baseline entries dropped). Print a rename hint when a baselined symbol moves files.
1 parent 09158b4 commit ca7717c

3 files changed

Lines changed: 38 additions & 367 deletions

File tree

‎knip.jsonc‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
// Required/discoverable barrels whose children have direct live imports.
3838
// Ignore only the barrel file finding, so it cannot keep dead children alive.
3939
"ignoreIssues": {
40+
// Generated contracts mirror their source of truth; regenerating them must not
41+
// trip the unused-export ratchet, and hand edits would be overwritten.
42+
"lib/mothership/generated/**": ["exports", "types", "duplicates"],
4043
"sandbox-tasks/index.ts": ["files"],
4144
"components/mcp/index.ts": ["files"],
4245
"triggers/quickbooks/index.ts": ["files"],
@@ -91,7 +94,11 @@
9194
},
9295
"packages/ts-sdk": { "entry": ["examples/*.ts"] },
9396
// The contract audit reads this snapshot by filename.
94-
"packages/desktop-bridge": { "entry": ["contract-snapshot.ts"] },
97+
// Generated, so its export surface is not ratcheted either.
98+
"packages/desktop-bridge": {
99+
"entry": ["contract-snapshot.ts"],
100+
"ignoreIssues": { "contract-snapshot.ts": ["exports", "types", "duplicates"] }
101+
},
95102
// This shared config is consumed by apps that own the Next dependency.
96103
"packages/tsconfig": { "ignoreUnresolved": ["next"] }
97104
}

0 commit comments

Comments
 (0)