Migrating from unimported
unimported reports dangling files, unused dependencies, and unresolved imports. rev-dep covers all three and folds them into one config with the rest of its checks.
Why migrate​
- unimported is archived. It is no longer maintained and its README points elsewhere - so moving off it is overdue.
- Speed and a single pass. rev-dep is Go-based - faster on large repos.
- More checks. On top of unimported's three, rev-dep adds unused exports, missing dependencies, circular imports, and architecture rules.
What carries over, what changes​
- Covered well: unimported (orphan) files, unused dependencies, unresolved imports.
- Entry points. unimported derives entry files (or you set
entry); rev-dep usesprodEntryPoints/devEntryPointsthe same way to anchor reachability. - Autofix. unimported's
--fixremoves dangling files; rev-dep'sorphanFilesDetectionautofix does the same underconfig run --fix.
Feature mapping​
| unimported | rev-dep |
|---|---|
| unimported files | orphanFilesDetection |
| unused dependencies | unusedNodeModulesDetection |
| unresolved imports | unresolvedImportsDetection |
entry | prodEntryPoints / devEntryPoints |
ignoreUnimported | orphan validEntryPoints / ignoreEntryPoints |
ignoreUnused | excludeModules |
ignoreUnresolved | ignoreImports on unresolvedImportsDetection |
ignorePatterns | ignoreFiles |
aliases | tsconfig.json paths (read automatically) |
--fix | config run --fix (orphan files) |
Translating your config​
A .unimportedrc.json:
{
"entry": ["src/index.ts"],
"ignorePatterns": ["**/*.stories.tsx"],
"ignoreUnused": ["husky"],
"ignoreUnresolved": ["virtual:*"]
}
becomes a rev-dep.config.jsonc:
{
"ignoreFiles": ["**/*.stories.tsx"],
"rules": [
{
"path": ".",
"prodEntryPoints": ["src/index.ts"],
"unresolvedImportsDetection": {
"enabled": true,
"ignoreImports": ["virtual:*"]
},
"unusedNodeModulesDetection": {
"enabled": true,
"excludeModules": ["husky"]
},
"orphanFilesDetection": {
"enabled": true,
"autofix": true
}
}
]
}
Running it​
# unimported
npx unimported
# rev-dep
rev-dep config run
rev-dep config run --fix # removes dangling files
Next steps​
- Verify resolution first with
unresolvedImportsDetection- see unresolved imports troubleshooting. - In monorepos, run orphan-file detection at the root: orphan files and unused exports in shared packages.