Skip to main content

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/parsers to recognize packages used by config ecosystems. rev-dep handles the same gap with explicit hints (pkgJsonFieldsWithBinaries, filesWithBinaries, filesWithModules) - see unused node modules.

Feature mapping​

depcheckrev-dep
unused dependenciesunusedNodeModulesDetection
missing dependenciesmissingNodeModulesDetection
ignoreMatchesexcludeModules
ignorePatternsignoreFiles (top-level)
skipMissingsimply 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​