Code Style

TypeScript

  • Strict mode is enabled across all packages
  • Use const exclusively — no let or var
  • Prefer pure functions and immutable data
  • Use explicit return types on exported functions

Formatting

We use Prettier with the following configuration:

RuleValue
Print width100
Tab width2
SemicolonsYes
Single quotesYes
Trailing commasAll

Run the formatter:

pnpm format

Linting

ESLint enforces code quality rules:

pnpm lint

Naming conventions

ElementConventionExample
Fileskebab-caseuser-profile.ts
FunctionscamelCasegetUserById
TypesPascalCaseUserProfile
ConstantsUPPER_SNAKEMAX_RETRIES
ComponentsPascalCaseUserProfile.tsx

Imports

Imports are sorted automatically by the formatter:

  1. Node.js built-ins
  2. External packages
  3. Internal packages (@acme/*)
  4. Relative imports