Menu

Post image 1
Post image 2
1 / 2
0

Find Dead Code with Knip: The Blind Spots ESLint and depcheck Miss

DEV Community·Recca Tsai·about 1 month ago
#yZBMw8a9
#node#typescript#software#coding#knip#unused
Reading 0:00
15s threshold

Originally published at recca0120.github.io The project is two years old. There are 80 entries in package.json and you can't say with confidence which ones are still being used. A utils.ts file hasn't been touched in three months — you're not sure if anyone imports it. shared/helpers.ts exports a dozen functions, some of which were replaced by newer approaches months ago, but nobody deleted the old ones. Dead code doesn't accumulate overnight. A little left over from each refactor, one forgotten dependency from each package swap. Over time the project gets heavier, but no tool ever tells you exactly what's dead. Knip is built for exactly this. One command finds everything you thought was being used but isn't. The Blind Spots in ESLint and depcheck Most teams reach for ESLint and depcheck to handle this kind of thing. Both have clear limits. ESLint only sees a single file.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More