Skip to content

buildingopen/dep-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dep-check

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.

Install

curl -fsSL https://raw.githubusercontent.com/buildingopen/dep-check/main/dep-check -o ~/.local/bin/dep-check
chmod +x ~/.local/bin/dep-check

Usage

dep-check          # check all source files
dep-check --json   # JSON output

How it works

  1. git ls-files to find all tracked source files
  2. grep to extract relative imports (./ and ../)
  3. Check if each import target exists on disk (with common extensions: .ts, .tsx, .js, .jsx, .py, .go, .rs, /index.*)

Limitations

  • Only checks relative imports (./ and ../), not package imports
  • TypeScript/JavaScript, Python only (for now)
  • Does not resolve tsconfig path aliases

Requirements

  • git
  • jq (only for --json)

License

MIT

About

Find dead imports in your project. One bash script.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages