Skip to Content
StandardsCode Style - Engineering Handbook

Last Updated: 1/28/2026


Code Style Guide

Consistency is key. Follow these conventions.

TypeScript

Naming

// Classes: PascalCase class UserService { } // Functions: camelCase function getUserById(id: string) { } // Constants: SCREAMING_SNAKE_CASE const MAX_RETRY_ATTEMPTS = 3; // Interfaces: PascalCase (no I prefix) interface User { } // Good interface IUser { } // Avoid

Types

Always use explicit types:

// Good function getUser(id: string): Promise<User> { } // Avoid function getUser(id) { }

Error Handling

class NotFoundError extends Error { constructor(resource: string, id: string) { super(`${resource} with id ${id} not found`); this.name = 'NotFoundError'; } }

Formatting

We use Prettier with these settings:

{ "semi": true, "singleQuote": true, "tabWidth": 2, "trailingComma": "es5" }

Run before committing:

npm run format