TypeScript
Strict Mode
The project uses TypeScript strict mode. All code must:- Have explicit types for function parameters and return values
- Avoid
anytypes unless absolutely necessary - Handle null/undefined cases properly
- Use type guards for runtime type checking
Functional Components
Prefer functional React components over class components:Naming Conventions
Files
Use kebab-case for all filenames:Components
Use PascalCase for exported component names:Variables and Functions
Use camelCase for variables and function names:Constants
Use SCREAMING_SNAKE_CASE for constants:Types and Interfaces
Use PascalCase for type and interface names:Imports
Path Aliases
Use the@/ alias for repo-root paths:
Import Order
Organize imports in this order:- External dependencies (React, Next.js, etc.)
- Internal components and utilities
- Types and interfaces
- Styles
Styling
Tailwind CSS
Use Tailwind CSS v4 utility classes for all styling:Shared UI Components
Reuse components fromcomponents/ui/* (shadcn/ui):
Conditional Classes
Use utility libraries likeclsx or cn for conditional classes:
Linting
ESLint Configuration
The project uses ESLint withnext/core-web-vitals rules:
Running the Linter
Pre-commit Requirements
Fix all lint errors before committing. Common issues:- Unused variables or imports
- Missing dependencies in
useEffect - Incorrect Hook usage
- Type errors
Project Structure
Directory Organization
Module Organization
app/: Next.js pages, layouts, and API routescomponents/: Reusable UI and feature componentslib/: Business logic, utilities, and testspublic/: Static files (images, fonts, etc.)
