Skip to content

Issue Reproduction

If you encounter an issue or false positives when using Knip, you can open an issue on GitHub. This will help you in your project, and will also improve Knip for everyone else!

There are many factors that may influence the issue at hand, such as:

  • Code syntax, import and export structure in source files
  • Dependencies, scripts and entry files in package.json
  • TypeScript configuration in tsconfig.json
  • Enabled plugins and configuration files for that tooling
  • Dependent or depending workspaces in a monorepo
  • Knip configuration in knip.json

Think of Knip like a kitchen sink, it handles a large amount of projects and configurations, and your project is different from all others. That’s why it’s required to provide a minimal reproduction. This contains only the source code and configuration required to demonstrate the issue. Providing this with a clear issue description will help us help you, and greatly improves the chances your issue will be looked into efficiently and in a timely manner.

Issues containing just a screenshot, a snippet of output, or a snippet of source code don’t tell the full picture. Only an actual reproduction of the issue with source code and configuration is complete and actionable.

Before opening an issue

Before opening an issue, please make sure you:

  • are using the latest version
  • have read the relevant documentation
  • have searched existing issues
  • have checked the list of known issues

Please file only a single issue at a time, so each of them can be labeled and tracked separately.

Templates

A convenient way to create a minimal reproduction so is by starting with one of these templates in CodeSandbox or StackBlitz:

Template
BasicCodeSandboxStackBlitz
MonorepoCodeSandboxStackBlitz

Other solutions may work well too. For instance, many people choose to create a small repository on GitHub. The goal is to have an easy and common understanding and reproduction.

Providing a link to your existing project repository will likely not be considered “minimal”.

Pull Request

The optimal way is to add fixtures and/or failing tests to the Knip repository, and open a pull request to discuss the issue! Also see instructions for development.

ISC License © 2024 Lars Kappert