Skip to content

💡 Flag methods as unused if they are only imported by their respective test files #1459

@mcmxcdev

Description

@mcmxcdev

Suggest an idea for Knip

We have plenty of code in our codebase that is only imported in a test file, never in production code.

Imagine isUrl.ts and then isUrl.test.ts as only occurrence where it gets imported. This correctly is not flagged by knip, but it would be helpful for us to get rid of legacy code that is "unused".

This shouldn't be default but could be supported by a flag to opt-in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions