- Prefer
interfaceovertypefor object shapes - Avoid enums; use
as constobjects instead - Path alias:
@/*maps to project root
| Type | Convention | Example |
|---|---|---|
| Directories | lowercase-dashes | auth-wizard/ |
| Components | PascalCase | AuthWizard.tsx |
| Variables | camelCase + auxiliary verbs | isLoading, hasError |
| Functions | camelCase | fetchUserData() |
Use function keyword for pure functions. Favor named exports.
Order within component files:
- Exported component
- Subcomponents
- Helpers
- Static content
- Types
- No semicolons
- Single quotes
- 2-space indentation
- Trailing commas (ES5)
- 100 char line width
- Tailwind class sorting via prettier-plugin-tailwindcss
- Minimize
'use client'- prefer Server Components - Use client components only for Web API access
- Wrap client components in
Suspensewith fallback - Use dynamic imports for non-critical components
- Titles under 80 characters, concise and specific
- Descriptions under 5 sentences
- Include summary and test plan
Structure reviews with:
- Summary of changes
- Issues table with severity and suggested solutions
- What was verified (build, lint, etc.)