Skip to content

πŸ”„ Export types from knipΒ #1840

Closed

Description

@adamhl8

Description of the regression

Not really an actual regression but I think it's the closest fit for this.

A while back (pre-6.0?) knip used to export many of its types. At some point that changed, and since then I've been using a script to patch knip's package.json in my node_modules folder to expose these again. I've been adding the following to the exports section:

"./types/issues": {
  "default": "./dist/types/issues.js",
  "types": "./dist/types/issues.d.ts",
}

That way I can do

import type { IssueRecords, IssueType, Preprocessor, ReporterOptions } from "knip/types/issues"

I use these types to build a knip preprocessor that I use in some of my projects.

Activity

  1. webpro commented on Jul 2, 2026

    @webpro
    Member

    Perhaps you mean that in v5 you might've been able to reach types through dist path (not officially exposed).

    In general I'm not too keen on increasing the public surface, it means more for me to keep track of and version. Yet what you need in this case is already reachable through the public types.

    Anyway I'll expose Issue, IssueRecords, IssueType β€” that should have you covered.

  2. webpro commented on Jul 2, 2026

    @webpro
    Member

    πŸš€ This issue has been resolved in v6.24.0. See Release 6.24.0 for release notes.

    Using Knip in a commercial project? Please consider becoming a sponsor.

  3. adamhl8 commented on Jul 2, 2026

    @adamhl8
    Author

    Thanks!

  4. added a commit that references this issue on Jul 3, 2026
    260f192
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

    regressionSomething is no longer working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions