Getting Started
Read getting started to install and run Knip
Are you using Knip at work? Please consider sponsoring me!
Getting Started
Read getting started to install and run Knip
Why Use Knip?
Understand what Knip can do for you
Troubleshooting
Need help? Start troubleshooting here
Plugins
Check out the list of plugins
Special thanks to the wonderful people who have contributed to this project!
Ran http://knip.dev in @argos_ci, and boom 💥! Dead code detected instantly. With a good config, it can run on CI to keep projects clean. Installing this tool should be a no-brainer, like Prettier or ESLint.
Kudos, @webprolific! 👏
Problem:
🚫 Your project has unused files.
🚫 It has unused npm dependencies.
🚫 It has unused TypeScript exports.
But you haven't noticed, because these things are hard to spot.
Solution: knip
I just used knip to find and resolve dozens of issues.
https://t.co/QmN3sNlmbm
Knip helped me get rid of over 41k lines of code in legacy codebase 🥺🥺💕
Big fans of Knip at @Contra. Such an extremely well developed and maintained project
Just tried this on https://github.com/getsentry/sentry/ - got some super useful results! Nice work.
I've manage to delete 6k LOC in the last 30 minutes 🫣
Great job here @webprolific 👍🏽
knip is an amazing tool. Shoutout to @webprolific for building it 🙌.
Not cleaning up correctly has a real maintenance cost. I've deleted lots of dead code - functions that were only used in tests and components that were only used in stories - all thanks to knip 🚀.
🛠️ Knip
👉🏻 Knip finds unused files, dependencies and exports in your JavaScript and TypeScript projects.
👉🏻 Less code and dependencies lead to improved performance, less maintenance and easier refactorings.
https://github.com/webpro/knip
Knip is wonderful at finding out unused code/dependencies in a legacy JavaScript/TypeScript application
Recommend 💯
Here's how Josh used it to remove code bloat in Centered:
Unused files, exports, and dependencies often clutter projects, as it’s difficult knowing when one thing relies on another and scary to remove something you’re not sure is in use. 👀
↬ Meet Knip, which scours projects for these unused artifacts: https://www.smashingmagazine.com/2023/08/knip-automated-tool-find-unused-files-exports-dependencies/
Recommendation update: use knip to find dead code, types and dependencies in your @typescript ✂️https://effectivetypescript.com/2023/07/29/knip/
This is worth checking out on GitHub. 👍 https://github.com/webpro/knip
Streamlining React projects with Knip:
Recently, I employed Knip for a project, and it worked wonders!
It efficiently resolved issues with removing
✅ Unused files,
✅ Unused npm dependencies,
✅ Unneeded TypeScript exports.
A real time-saver for maintaining a clean and efficient codebase. 🛠️ #ReactDevelopment
https://t.co/IbJH2fIzsE
Found a bunch of unused code, -dependencies, and unnecessary exports. Had just one false positive but overall pretty good. 10/10 would recommend.
If you’ve got a JavaScript package/project use Knip and remove unnecessary code. ✂️
Have or know about a nice resource about or project using Knip? Feel free to propose a change and add it to this page!
ISC License © 2024 Lars Kappert