Migrating from depcheck
depcheck finds unused and missing dependencies. rev-dep does the same with two checks, and adds the rest of a dependency-hygiene suite.
Why migrate​
- depcheck is no longer maintained. Its README now recommends moving on - so a migration is worthwhile regardless.
- Speed. rev-dep is Go-based and runs in a single parallel pass - faster on large repos.
- More than dependencies. rev-dep also covers unused exports, orphan files, circular imports, dev-deps in production, and architecture rules.
What carries over, what changes​
- Covered well: unused dependencies, missing (unlisted) dependencies.
- Tooling-only packages. depcheck has
specials/parsersto recognize packages used by config ecosystems. rev-dep handles the same gap with explicit hints (pkgJsonFieldsWithBinaries,filesWithBinaries,filesWithModules) - see unused node modules.
Feature mapping​
| depcheck | rev-dep |
|---|---|
| unused dependencies | unusedNodeModulesDetection |
| missing dependencies | missingNodeModulesDetection |
ignoreMatches | excludeModules |
ignorePatterns | ignoreFiles (top-level) |
skipMissing | simply don't enable missingNodeModulesDetection |
specials / parsers (non-import usage) | pkgJsonFieldsWithBinaries / filesWithBinaries / filesWithModules |
Translating your config​
A .depcheckrc:
ignores:
- "@types/*"
- "husky"
ignorePatterns:
- "dist"
- "*.stories.tsx"
skipMissing: false
becomes a rev-dep.config.jsonc:
{
"ignoreFiles": ["dist/**", "**/*.stories.tsx"],
"rules": [
{
"path": ".",
"unusedNodeModulesDetection": {
"enabled": true,
"excludeModules": ["@types/*", "husky"]
},
"missingNodeModulesDetection": {
"enabled": true
}
}
]
}
Running it​
# depcheck
npx depcheck
# rev-dep
rev-dep config run
Both exit non-zero on findings. In a monorepo, declare dependencies in the package that compiles the code - see missing or unused dependency false positives.
Next steps​
- Unused node modules and missing node modules check options.
- Monorepo integration guide.