Skip to content

chore(tooling): add knip configuration to detect unused files, dependencies and exports across the monorepo #645

Description

@sundaram2021

Is your feature request related to a problem? Please describe.

knip is already listed as a root devDependency ("knip": "^6.22.0" in package.json), but there is no Knip configuration file or script anywhere in the repo, so the tool is currently unusable. With 11 apps (apps/) and 23 packages (packages/) in this Turborepo workspace, unused files, dependencies, and exports accumulate silently over time — there is no automated way to detect them.

Describe the solution you'd like

Add a Knip configuration tailored to this monorepo:

  • A knip.json (or equivalent config) at the repo root defining:
    • Workspaces for all entries under apps/* and packages/*
    • Entry points matching our conventions (Next.js app router for dashboard/docs, Elysia entry files for api/basket, Drizzle schemas/configs, tracker/SDK build outputs, test files, etc.)
    • Ignore patterns for generated code, config files, and intentionally-kept exports
  • A root script (e.g., "knip": "knip") so it can be run locally via bun run knip
  • Optionally wire it into CI alongside lint / check-types

This gives us a single command to surface unused dependencies, exports, files, and duplicate configs across every workspace.

Describe alternatives you've considered

  • Running npx/bunx knip ad hoc without committed config — results would be noisy and non-reproducible across contributors.
  • Alternative tools like depcheck or ts-prune — they cover only parts of what Knip does (no monorepo workspace support, no unused-file detection) and are less maintained.

Additional context

  • Knip v6 is already pinned in root devDependencies, so no new dependency is needed — only configuration and wiring.
  • Should play nicely with existing tooling: Bun workspaces, Turborepo task graph, Biome/Ultracite lint setup, and the catalog: dependency protocol in package.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions