Related Tooling
This is an overview of related tooling for features Knip does not support.
Unused variables
Section titled “Unused variables”Knip doesn’t look for unused variables within a file. The focus is on exported and imported values and types across files.
Use ESLint, Biome or oxlint to find unused variables within files.
Use remove-unused-vars to remove unused code within files, but in a more valiant way. Using input from any of the above linters, it actually removes a lot more unused code. This pairs great with Knip.
Unused properties
Section titled “Unused properties”Knip does not yet support finding unused members of types, interfaces and objects. This includes returned objects from exported functions and objects passed as React component props.
Knip does support finding unused members of enums and classes, and exported values and types on imported namespaces.
Circular dependencies
Section titled “Circular dependencies”Knip has no issues with circular dependencies, and does not report them. Tools that do support this include DPDM, Madge and skott.
Cleanup
Section titled “Cleanup”The e18e.dev website and in particular the Cleanup section is a great resource when dealing with technical debt.
ISC License © 2024 Lars Kappert