Skip to content

Getting Started

Terminal window
npm install --save-dev domainlint

Or install globally:

Terminal window
npm install -g domainlint

From the root of your project:

Terminal window
domainlint check

This will analyze src/ and report any violations.

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.ts

Fix: import from the feature’s index.ts instead.

A circular dependency was detected in the module graph.

src/features/auth/session.ts noImportCycle
Cycle: auth/session.ts → auth/user.ts → auth/session.ts

Fix: break the cycle by extracting shared state to a third module or restructuring dependencies.

CodeMeaning
0No violations
1Violations found
2Internal error (e.g. unreadable tsconfig)