From 2d6368e494dfb19bce3efe4f9cdc376ceb22121c Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Tue, 14 Jul 2026 15:23:51 +0800 Subject: [PATCH] chore(knip): remove dead barrel files + silence knip false-positives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conservative first pass on the knip baseline (advisory gate stays advisory): - Remove src/components/clinical-dashboard/index.ts and ClinicalDashboard.tsx — vestigial re-export barrel/shim from the dashboard decomposition with ZERO importers (the real component is src/components/ClinicalDashboard.tsx, imported directly). Clears knip's "Unused files". - Declare @babel/parser as an explicit devDependency (pinned to ^7 to match the version the AST tests already use — v8 drops the "importAttributes" plugin). Clears knip's "Unlisted dependencies". - Add `railway` to knip ignoreBinaries (used by scripts/check-env-parity.mjs). Clears knip's "Unlisted binaries". The remaining ~179 unused exports / 72 types are intentional public-API/barrel surfaces that need per-item human judgment — deliberately NOT bulk-removed. Verified: typecheck / lint clean; the 3 @babel/parser AST tests pass (17/17); knip file/dependency/binary noise resolved. Co-Authored-By: Claude Opus 4.8 --- knip.json | 2 +- package-lock.json | 1 + package.json | 1 + .../clinical-dashboard/ClinicalDashboard.tsx | 1 - src/components/clinical-dashboard/index.ts | 15 --------------- 5 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 src/components/clinical-dashboard/ClinicalDashboard.tsx delete mode 100644 src/components/clinical-dashboard/index.ts diff --git a/knip.json b/knip.json index ec586847c..90bf5da82 100644 --- a/knip.json +++ b/knip.json @@ -14,7 +14,7 @@ "project": ["src/**/*.{ts,tsx}", "scripts/**/*.{ts,mjs,cjs}", "worker/**/*.ts", "eslint-rules/**/*.mjs"], "ignore": ["src/lib/supabase/database.types.ts", "**/*mockup*", "src/app/mockups/**", "supabase/functions/**"], "ignoreDependencies": ["tailwindcss", "server-only"], - "ignoreBinaries": ["supabase", "semgrep", "gitleaks", "taskkill"], + "ignoreBinaries": ["supabase", "semgrep", "gitleaks", "taskkill", "railway"], "vitest": { "config": ["vitest.config.mts"] }, "playwright": { "config": ["playwright.config.ts", "playwright.visual.config.ts"] } } diff --git a/package-lock.json b/package-lock.json index d69ab1376..29f6f33c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ }, "devDependencies": { "@axe-core/playwright": "^4.12.1", + "@babel/parser": "^7.29.7", "@next/bundle-analyzer": "^16.2.10", "@tailwindcss/postcss": "^4.3.2", "@testing-library/dom": "^10.4.1", diff --git a/package.json b/package.json index f5ade4773..fc4629090 100644 --- a/package.json +++ b/package.json @@ -166,6 +166,7 @@ }, "devDependencies": { "@axe-core/playwright": "^4.12.1", + "@babel/parser": "^7.29.7", "@next/bundle-analyzer": "^16.2.10", "@tailwindcss/postcss": "^4.3.2", "@testing-library/dom": "^10.4.1", diff --git a/src/components/clinical-dashboard/ClinicalDashboard.tsx b/src/components/clinical-dashboard/ClinicalDashboard.tsx deleted file mode 100644 index 4973c2930..000000000 --- a/src/components/clinical-dashboard/ClinicalDashboard.tsx +++ /dev/null @@ -1 +0,0 @@ -export { ClinicalDashboard } from "@/components/ClinicalDashboard"; diff --git a/src/components/clinical-dashboard/index.ts b/src/components/clinical-dashboard/index.ts deleted file mode 100644 index df78e0976..000000000 --- a/src/components/clinical-dashboard/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export { ClinicalDashboard } from "./ClinicalDashboard"; -export { AnswerEmptyState, AnswerSkeleton, CopyButton } from "./answer-status"; -export { useTheme } from "./use-theme"; -export { StatusBadge, StrengthBadge } from "./badges"; -export { GuideDialog, GuideTrigger, SectionHeading, UtilityDrawer } from "./dashboard-shell"; -export { MasterSearchHeader } from "./master-search-header"; -export { DocumentSearchResultsPanel, MatchExplanationChips } from "./document-search-results"; -export type { SearchFacets } from "./document-search-results"; -export { - hasStrongRelevanceIcon, - isWeakRelevance, - QueryCoverageChips, - relevanceChipLabel, - RelevanceBadge, -} from "./relevance";