--- title: "Coding Conventions" dimension: specs category: general keywords: - typescript - naming - style - convention readMode: required priority: high --- # Coding Conventions ## Naming - Use camelCase for variables and functions - Use PascalCase for classes and interfaces - Use UPPER_SNAKE_CASE for constants ## Formatting - 2-space indentation - Single quotes for strings - Trailing commas in multi-line constructs ## Patterns - Prefer composition over inheritance - Use early returns to reduce nesting - Keep functions under 30 lines when practical ## Error Handling - Always handle errors explicitly - Prefer typed errors over generic catch-all - Log errors with sufficient context