Knip: good software for cleaning up TypeScript tech debt
Today I noticed some dead code in the application I work on, Val Town. We have a bit of technical debt: a medium amount. Building technology in startups is all about having the right level of tech debt. If you have none, you're probably going too slow and not prioritizing product-market fit and the important business stuff. If you get too much, everything grinds to a halt. Plus, tech debt is a "know it when you see it" kind of thing, and I know that my definition of "a bunch of tech debt" is, to other people, "very little tech debt."
Anyway, I wanted to find unused code, and found Knip. And, wow - it worked on the first try. Sure, in our complex monorepo it flagged some false problems, but most of what it uncovered was valid, setting it up was very easy, and it's very fast. I am totally impressed.
I was able to prune more than 5 unused dependencies and a few hundred lines of code in 20 minutes by using knip's suggestions. Bravo!