@zuke/knip

← API reference

`@zuke/knip` — a typed `KnipTasks` wrapper for the [Knip](https://knip.dev)

Symbols

# KnipRunSettings class
class KnipRunSettings extends ToolSettings

Settings for a knip run.

MemberSignatureDoc
production production(): this Restrict analysis to production code paths (--production).
strict strict(): this Treat the production set strictly (--strict).
fix fix(): this Auto-remove unused exports/dependencies where possible (--fix).
cache cache(): this Enable the analysis cache (--cache).
noExitCode noExitCode(): this Always exit 0, even when issues are found (--no-exit-code).
config config(path: PathLike): this Use an explicit config file (--config).
workspace workspace(name: string): this Restrict to a single workspace (--workspace).
reporter reporter(name: string): this Choose the reporter, e.g. json or compact (--reporter).
include include(...types: string[]): this Limit to specific issue types, e.g. files, dependencies (--include).
# KnipTasks const
const KnipTasks: KnipTasksApi

Typed task functions for the knip CLI.

# KnipTasksApi interface
interface KnipTasksApi

The shape of KnipTasks.

MemberSignatureDoc
run run(configure?: Configure<KnipRunSettings>): Promise<CommandOutput> Find unused files, dependencies, and exports: knip.