674 B
674 B
Style Guide
- Use the Airbnb JavaScript style guide.
- Prefer functional components over class components.
Naming Conventions
- Pages: Use kebab-case (e.g.,
page-test.tsx) exactly like the route of the page - Files: Use PascalCase (e.g.,
task-list.tsx) - Components: Use PascalCase (e.g.,
TaskList) - Layouts: Use PascalCase (e.g.,
TaskList) - Hooks: Use camelCase (e.g.,
taskName) - Constants: Use UPPER_SNAKE_CASE (e.g.,
API_URL)
Best Practices
- Write pure functions where possible.
- Keep components small and focused on a single responsibility.
- Use TypeScript for type safety.