Code Quality Guidelines
Type Safety
- •Always use strict type checking
- •Avoid
anytypes - •Use discriminated unions for variant types
Error Handling
- •Never silently catch errors
- •Always provide context in error messages
- •Use error boundaries appropriately
Performance
- •Avoid O(n²) algorithms
- •Profile before optimizing
- •Consider memory implications
Code Organization
- •Keep functions small and focused
- •Use meaningful variable names
- •Follow single responsibility principle
- •Avoid deep nesting (max 3 levels)