diff --git a/knip-baseline.json b/knip-baseline.json index 5349b3e4..4a0aca99 100644 --- a/knip-baseline.json +++ b/knip-baseline.json @@ -1,4 +1,4 @@ { - "count": 78, - "comment": "Dead-code ratchet baseline for issue #282 (cairn MVG gate #6). This is the knip issue count at the time the gate was introduced — pre-existing unused exports/types that are out of scope to remove in the gate PR. The ratchet (scripts/check-deadcode-ratchet.mjs) fails the build only if the count rises above this number. When dead code is removed and the count drops, lower this value in the same PR to lock in the gain. Per-category false positives belong in knip.json, not here." + "count": 85, + "comment": "Dead-code ratchet baseline for issue #282 (cairn MVG gate #6). The ratchet (scripts/check-deadcode-ratchet.mjs) reads only `count` and fails the build only if the current knip issue count rises above it; when dead code is removed and the count drops, lower this value in the same PR to lock in the gain. Suppress false positives in knip.json — via ignore/ignoreDependencies, or by declaring the workspace so its entry points are reachable — never absorb them into this baseline. The remaining 85 are pre-existing unused exports and types, tracked in #682." } diff --git a/knip.json b/knip.json index 77cbfed1..1b92ebd7 100644 --- a/knip.json +++ b/knip.json @@ -20,7 +20,11 @@ "docs": { "entry": ["astro.config.mjs", "src/content.config.ts", "src/components/**/*.astro"], "project": ["src/**/*.{astro,ts,tsx}"], - "ignoreDependencies": ["@astrojs/check", "remark-gfm", "@pagefind/default-ui", "jest"] + "ignoreDependencies": ["@astrojs/check", "markdown-link-check", "remark-gfm", "@pagefind/default-ui", "jest"] + }, + "integrations/jira-forge-app": { + "entry": ["src/index.js!", "test/**/*.test.js"], + "project": ["src/**/*.js!", "test/**/*.js"] } } } diff --git a/package.json b/package.json index 0faac344..a6794075 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "knip": "knip" }, "devDependencies": { - "@astrojs/check": "^0.9.9", "knip": "6.23.0" }, "resolutions": { diff --git a/scripts/check-deadcode-ratchet.mjs b/scripts/check-deadcode-ratchet.mjs index d7430f9d..8335c8a9 100644 --- a/scripts/check-deadcode-ratchet.mjs +++ b/scripts/check-deadcode-ratchet.mjs @@ -49,9 +49,13 @@ const baselinePath = join(repoRoot, 'knip-baseline.json'); // array-of-arrays (one inner array per duplicate group), so its `.length` // counts groups, which is the unit we ratchet on. // -// This is the complete set of countable keys for the installed knip (6.20.0, -// pinned exactly). There is no `nsExports`/`nsTypes`/`classMembers` in this -// schema — namespace/enum members surface as `namespaceMembers`/`enumMembers`. +// This is the complete set of countable keys for the installed knip (6.23.0, +// pinned exactly). `nsExports`/`nsTypes` also exist in this schema but are +// default-excluded by knip, so they never appear in our JSON; add them here if +// that ever changes — otherwise the reporter would emit findings COUNTED_KEYS +// silently drops, an under-count in the one direction this gate exists to +// catch. There is no `classMembers` — namespace/enum members surface as +// `namespaceMembers`/`enumMembers`. // If knip is bumped, re-derive this list from its JSON (the countIssues guard // below will fail loud if the top-level shape changes). const COUNTED_KEYS = [