Skip to main content

Coding Style & Linting

ADM enforces a single source-of-truth for style:

  • ESLint@eslint/js + custom rules
  • Prettier – code formatting
  • commitlint – conventional-commits

ESLint + Prettier

npm run lint        # read-only
npm run format # auto-fix + prettier

CI will fail if npm run lint reports errors or if Prettier formatting changes are uncommitted.

Typical workflow

git checkout -b feat/my-awesome-change
# …code…
npm run format
git add .
git commit -m "feat(core): add awesome change"

The commit message is checked by commitlint. Prefix your commit with one of the following:

PrefixDescriptionExample Commit Command
featA new featuregit commit -m "feat: add new schema"
fixA bug fixgit commit -m "fix: correct null pointer exception"
docsDocumentation only changesgit commit -m "docs: update installation instructions"
choreRoutine tasks, maintenance, or toolinggit commit -m "chore: update dependency versions"
refactorCode changes that neither fix nor add featuresgit commit -m "refactor: simplify token validation"
testAdding or updating testsgit commit -m "test: add tests for date parser"
perfPerformance improvementsgit commit -m "perf: optimize query performance"

TypeScript strictness

The library is compiled with "strict": true and imports must be path-alias aware (@/…). Run npm run build to catch any type errors locally.