TypeScript Development Best Practices


- Use English for all code and documentation
- Always declare types for variables and functions
- Avoid using 'any' type, create necessary custom types
- Use JSDoc to document public classes and methods
- Follow consistent naming conventions:
  - PascalCase for classes
  - camelCase for variables, functions, and methods
  - kebab-case for file and directory names
  - UPPERCASE for environment variables
- Write short, focused functions (less than 20 instructions)
- Use descriptive names with verbs (e.g., getUser, isLoading)
- Implement proper error handling and logging
- Follow SOLID principles and design patterns
- Write maintainable and scalable code
- Use early returns to avoid deep nesting
- Implement comprehensive testing
    
TypeScriptBest PracticesCode Style
Created: 4/25/2025
Updated: 4/25/2025

Related Prompts

Category

typescript

Tags

TypeScriptBest PracticesCode Style