Files
HealthLog/knip.json
T
Marc-André Bombeck cbf5546122 chore(ci): wire knip workflow to fail on unused exports
Installs knip 6.14.1 as a devDependency, ships a curated knip.json
covering every Next.js App Router special file plus the worker / script
/ test entry points, and adds a workflow that runs on every push to
main and every PR targeting main.

The gate trips on:
- unused files (a new orphan module ships zero callers)
- unused dependencies (a production dep with no consumer left behind)
- unused devDependencies (same, in dev land)
- unlisted binaries (a package.json script reaches for a CLI without
  declaring it)

Unused-exports + unused-types stay informational this release because
the v1.4.40 W-GHOSTS sweep cleared 1 177 lines of dead code but the
historic exported-surface backlog still sits at ~ 487 exports + 52
types. Cleaning that incrementally avoids a single mega-PR risk.

Baseline carve-outs in knip.json:

ignore — three files W-GHOSTS missed in v1.4.40 (kept as known-zero
callers until a follow-up wave can verify they're safe to delete with
their dedicated test removed in the same commit):
- e2e/setup/test-helpers.ts (9-line barrel; future-multi-user hook)
- src/components/charts/compliance-line-chart.tsx (chart module only
  referenced by a touch-action contract test)
- src/lib/logging/index.ts (21-line barrel re-export)

ignoreDependencies — runtime / build-time deps loaded outside the
import graph:
- @hookform/resolvers, react-hook-form: dynamic + framework conv.
- @prisma/client: re-exported via src/generated/ (which is ignored)
- next-themes: ThemeProvider mounts via dynamic import
- @vitejs/plugin-react: vitest.config consumer
- shadcn, tailwindcss, tw-animate-css: build pipeline
- testcontainers: integration-test bootstrap
- @types/* : ambient typings

ignoreBinaries — invoked via shell from integration helpers or
declared via :
- docker, docker-compose, pg_isready (integration setup)
- tsx (the openapi:generate + openapi:check scripts run via npx tsx)
2026-05-21 12:26:53 +02:00

74 lines
1.7 KiB
JSON

{
"$schema": "https://unpkg.com/knip@6/schema.json",
"entry": [
"src/app/**/page.tsx",
"src/app/**/layout.tsx",
"src/app/**/route.ts",
"src/app/**/loading.tsx",
"src/app/**/not-found.tsx",
"src/app/**/error.tsx",
"src/app/**/global-error.tsx",
"src/app/**/template.tsx",
"src/app/**/opengraph-image.tsx",
"src/app/**/twitter-image.tsx",
"src/app/**/icon.tsx",
"src/app/**/apple-icon.tsx",
"src/app/**/manifest.ts",
"src/app/**/robots.ts",
"src/app/**/sitemap.ts",
"src/app/**/default.tsx",
"src/middleware.ts",
"src/instrumentation.ts",
"src/lib/jobs/**/*.ts",
"src/lib/health/**/*.ts",
"scripts/**/*.ts",
"scripts/**/*.mjs",
"e2e/**/*.spec.ts",
"e2e/**/*.test.ts",
"tests/**/*.test.ts",
"tests/**/setup.ts",
"vitest.config.ts",
"vitest.config.integration.ts",
"playwright.config.ts",
"next.config.ts",
"eslint.config.*",
"knip.json"
],
"project": [
"src/**/*.{ts,tsx}",
"scripts/**/*.{ts,mjs}",
"tests/**/*.ts",
"e2e/**/*.ts"
],
"ignore": [
"src/generated/**",
"prisma/**",
"public/**",
".next/**",
"**/__mocks__/**",
"e2e/setup/test-helpers.ts",
"src/components/charts/compliance-line-chart.tsx",
"src/lib/logging/index.ts"
],
"ignoreDependencies": [
"@types/node",
"@types/react",
"@types/react-dom",
"@hookform/resolvers",
"react-hook-form",
"@prisma/client",
"next-themes",
"@vitejs/plugin-react",
"shadcn",
"tailwindcss",
"testcontainers",
"tw-animate-css"
],
"ignoreBinaries": [
"docker",
"docker-compose",
"pg_isready",
"tsx"
]
}