AGENTS.typescript.md — TypeScript and JavaScript

Additive to ../AGENTS.md. Applies to every .ts, .tsx, .js, .jsx, .mjs and .cjs file, browser or Node. React rules are in AGENTS.react.md.

Build and check

<pm> run lint               # ESLint with --max-warnings=0
<pm> run typecheck          # tsc --noEmit
<pm> run format:check       # prettier --check .
<pm> test

<pm> is the package manager your lockfile names: pnpm-lock.yaml, yarn.lock or package-lock.json. One lockfile per package. Never commit a second one.

TypeScript rules

Node rules

Dependencies

Testing

Anti-patterns seen in this repo