Code Style¶
TypeScript¶
- Use kebab-case for files
- Prefer named exports
- Add JSDoc comments for public APIs
React¶
- Functional components only
- Custom hooks for shared logic
- Use Tailwind for styling
Formatting¶
- 2-space indentation
- Double quotes for strings
- Semicolons required
Pre-commit Setup¶
This project uses Husky and lint-staged to automatically format and lint code before commits.
What Happens on Commit¶
- JavaScript/TypeScript files (
.js,.jsx,.ts,.tsx): - ESLint runs with
--fix -
Prettier formats the code
-
Other files (
.json,.css,.md,.mdx): - Prettier formats the code
Manual Commands¶
pnpm format # Format all files
pnpm format:check # Check formatting
pnpm lint # Lint JavaScript/TypeScript