Variables
Variable naming changes based on context:
- Default variables:
camelCase/UPPER_CASE - Global consts: may be
PascalCase - Destructured variables: flexible for interop
- Booleans: prefixes required (unless destructured)
*Componentfilter allows PascalCase component variables- Node.js common variables (
__filename,__dirname) are exempted
Pages:
- Default
- Const / Global
- Destructured
- Boolean Prefix
- Boolean Destructured
- Node.js Common Variables
- *Component
✅ Good
ts
const MAX_RETRIES = 3; // WHY: UPPER_CASE for configuration constant
let userName = 'Alice'; // WHY: camelCase runtime variable❌ Bad
ts
const max_retries = 3; // WHY: snake_case discouraged for global/const variables