16 lines
697 B
Text
16 lines
697 B
Text
---
|
|
description:
|
|
globs: *.ts,*.js
|
|
alwaysApply: false
|
|
---
|
|
# JavaScript/TypeScript Naming Conventions
|
|
|
|
- Use camelCase for all variable names (`userProfile`, `itemCount`, `fetchData`)
|
|
- Use camelCase for function and method names (`calculateTotal`, `getUserInfo`)
|
|
- Use SCREAMING_SNAKE_CASE for constants (`API_KEY`, `MAX_ATTEMPTS`, `DEFAULT_TIMEOUT`)
|
|
- Use PascalCase for class and component names (`UserProfile`, `PaymentForm`)
|
|
- Use descriptive names that clearly indicate the purpose or content
|
|
- Avoid single-letter variable names except in small loop contexts
|
|
- Prefix boolean variables with "is", "has", or "should" for clarity
|
|
- Maintain consistent naming patterns throughout the codebase
|
|
|