TypeScript Style Guide

Use the Node.js and TypeScript versions declared by the project and follow its compiler options, ESLint and Prettier configuration.

  • Type public interfaces, narrow unknown input before use, and avoid unchecked any or assertions.
  • Use const unless reassignment is required. Prefer descriptive camelCase names, PascalCase types and small modules.
  • Handle rejected promises and external failures explicitly. Do not log credentials.
  • Keep browser, server and test modules separated. Preserve the lockfile and declared package manager.
export function normalizeName(value: string): string {
  return value.trim();
}

Run the configured build, typecheck, lint, formatting and test targets. ESLint, Prettier and Vitest are optional registry tools; do not assume every tool is installed.