Find dead imports in your project. Catches imports that reference files that don't exist.
$ dep-check
Dead imports:
src/components/Header.tsx -> ./OldButton
src/utils/api.ts -> ./deprecated/client
2 dead imports found.
curl -fsSL https://raw.githubusercontent.com/buildingopen/dep-check/main/dep-check -o ~/.local/bin/dep-check
chmod +x ~/.local/bin/dep-checkdep-check # check all source files
dep-check --json # JSON outputgit ls-filesto find all tracked source filesgrepto extract relative imports (./and../)- Check if each import target exists on disk (with common extensions: .ts, .tsx, .js, .jsx, .py, .go, .rs, /index.*)
- Only checks relative imports (
./and../), not package imports - TypeScript/JavaScript, Python only (for now)
- Does not resolve tsconfig path aliases
gitjq(only for--json)
MIT