Skip to content

Add knip to CI to catch dead code #1483

Description

@l2ysho

Note

TL;DR — related to #1481, lets ensure we are not letting dead code in PRs

Proposal

  • Add knip as a dev dependency and a knip.json config:
    • entry points: src/entrypoints/*.ts, scripts/**/*.ts, tests
    • ignore website/ (separate Docusaurus app)
    • ignore __APIFY_KEYRING_NATIVE_SUBPACKAGE__ (build-time placeholder)
    • turn off types and exports rules at first — about 47 hits today are symbols used inside their own file, so only the export keyword is extra
  • Add a pnpm run knip script and run it in the lint job.
  • Check the install-size impact. knip is a dev dependency, so the published package does not change.

Open questions

  • Fail the build or only warn at first?
  • Turn on the exports rule later, after a cleanup pass?

Related: #1481 (one-off cleanup found with knip).

🤖 Generated with Claude Code

Activity

  1. added theissue type on Oct 9, 2026
  2. added
    infrastructureIssues related to infrastructure or CI/CD pipeline.
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    infrastructureIssues related to infrastructure or CI/CD pipeline.t-buildersIssues owned by the Builders team.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions