Skip to content

🧩 Ignore specific unused function export in a file #1311

@0xCodeMaieutics

Description

@0xCodeMaieutics

Discuss anything related to Knip

Is it possible to ignore an unused function export either using a comment like with eslint:

src/index.ts

// ts-unused-exports:disable-next-line
export async function someFunc() {}
// This function is reported as unused
export async function someFunc2() {}

Maybe in this way using knip ignore comment:

// knip-unused-exports-function:disable-next-line
export async function someFunc() {}
// This function is reported as unused
export async function someFunc2() {}

Or is there a way to specify the config in knip.config.ts.

I just got introduced to the tool and am still noob. Any feedback is appreciated!

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