Getting Started
Installation
Section titled “Installation”npm install --save-dev domainlintpnpm add -D domainlintyarn add -D domainlintOr install globally:
npm install -g domainlintRun your first check
Section titled “Run your first check”From the root of your project:
domainlint checkThis will analyze src/ and report any violations.
Understanding violations
Section titled “Understanding violations”noCrossFeatureDeepImport
Section titled “noCrossFeatureDeepImport”A file outside a feature (or in a different feature) imported an internal module directly instead of going through the barrel.
src/pages/home.tsx:5:1 noCrossFeatureDeepImport Importing src/features/billing/ui/Button.tsx directly. Expected: src/features/billing/index.tsFix: import from the feature’s index.ts instead.
noImportCycle
Section titled “noImportCycle”A circular dependency was detected in the module graph.
src/features/auth/session.ts noImportCycle Cycle: auth/session.ts → auth/user.ts → auth/session.tsFix: break the cycle by extracting shared state to a third module or restructuring dependencies.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | No violations |
1 | Violations found |
2 | Internal error (e.g. unreadable tsconfig) |
Next steps
Section titled “Next steps”- Feature Structure — how domainlint identifies features and barrels
- Configuration — customize paths, extensions, and rule severity
- CLI Reference — all available flags
- Rules — learn about the built-in rules in detail
- Workspaces — monorepo support and cross-package import rules
- CI Integration — add domainlint to your pipeline