Skip to content

Issue Types

All issue types detected by Knip. See the official Knip issue types reference for complete documentation.

Overview

TypeDescriptionSeverity
filesUnused files not imported anywhereHigh
exportsUnused exports not consumedMedium
typesUnused type exportsMedium
dependenciesUnused production dependenciesHigh
devDependenciesUnused dev dependenciesMedium
unlistedUsed but not in package.jsonHigh
binariesUnused binaries from packagesLow
unresolvedUnresolved importsHigh
duplicatesDuplicate exportsLow
enumMembersUnused enum membersLow
classMembersUnused class membersLow

Unused Files

Files that are not imported by any entry point.

Fix: Delete the file or add it as an entry point.

Ignore:

json
{
  "ignore": ["**/fixtures/**"]
}

Unused Exports

Exported functions, classes, or variables not used elsewhere.

Fix: Remove the export or mark as used.

Ignore:

json
{
  "ignoreExportsUsedInFile": true
}

Unused Dependencies

Packages in dependencies not imported in code.

Fix: pnpm remove <package>

Ignore:

json
{
  "ignoreDependencies": ["some-peer-dep"]
}

Unlisted Dependencies

Imports that resolve but aren't in package.json.

Fix: pnpm add <package>

Unresolved Imports

Imports that cannot be resolved.

Fix: Install the missing package or fix the import path.

Further Reading

Released under the MIT License.