Maintain clean architecture in React/Next.js projects by analyzing cross-directory imports and component organization.
- Analyze imports between directories
- Generate HTML and JSON reports
- Support for JavaScript, TypeScript, JSX, TSX
- VS Code integration
- Enforce component directory structure
# Global installation
npm install -g import-checker
# Local project installation
npm install --save-dev import-checker
import-checker check <directory>
# Example: import-checker check src/features/user
# Options
-v, --verbose Detailed output
--no-html Skip HTML report
import-checker check-siblings <parent-directory>
# Example: import-checker check-siblings src/pages
# Options
-v, --verbose Detailed output
--no-html Skip HTML report
import-checker check-structure <directory>
# Example: import-checker check-structure src/features
# Options
-s, --skip <directories> Skip specific directories
-v, --verbose Detailed output
--no-html Skip HTML report
import-checker check-all <directory>
# Example: import-checker check-all src/features
# Options
-s, --skip <directories> Skip directories
-v, --verbose Detailed output
--no-html Skip HTML report
-o, --output <path> Custom output path
Create .importcheckerrc.json
:
{
"baseUrl": ".",
"outputDir": "./import-analysis",
"aliases": {
"@/*": "src/*",
"@components/*": "src/components/*"
}
}
- Interactive HTML reports
- Detailed JSON analysis
- Import counts and file information
- VS Code file links
- Feature isolation
- Code organization
- Dependency management
- Architectural compliance
Contributions welcome! Please submit a Pull Request.
MIT
- Contributions welcome! Submit a Pull Request
- Report issues on GitHub
- License: MIT