@archward/eslint-plugin
Deterministic DDD + clean architecture ESLint rules for TypeScript backends. Framework-agnostic core.
Install
pnpm add -D @archward/eslint-plugin
Usage
// eslint.config.mjs
import ddd from '@archward/eslint-plugin';
export default [
...ddd.configs.adr, // opt-in: lint docs/decisions/*.md
...ddd.configs.architecture({ topology: 'modular-monolith' }), // layer + context boundaries
];
The architecture preset enforces import direction with
eslint-plugin-boundaries
(bundled — no action needed) and classifies TypeScript path aliases with
eslint-import-resolver-typescript,
which you install as a peer and point at a resolvable tsconfig:
pnpm add -D eslint-import-resolver-typescript
eslint-import-resolver-typescript lists eslint-plugin-import(-x) as an
optional peer, so your package manager may print a peer warning if you have
neither — resolution works without them, so the warning is safe to ignore.
Rules
Automatically fixable by the --fix CLI option.
| Name | Description | |
|---|---|---|
| base/adr-structure | Enforce ADR structure: filename, an H1 title matching it, a valid date, the ordered sections, a status from the allowed set, no sub-headings, and per-section length limits. | |
| base/no-comments | Disallow comments except tool directives; rationale belongs in commit messages, ADRs, or docs. | |
| base/no-unclassified | Deny every source file by default; an allowed pattern must turn this rule off, so no file escapes the architecture. | |
| composition/root | Enforce module placement: a context module is named after its folder and a *.module.ts lives only at an allowed composition-root location. |
Rules are exposed under the arch/ namespace (e.g. arch/base/adr-structure) when you spread configs.adr.
License
MIT Amr Abdelaziz