Code Style
Formatting
We use automated tools to enforce consistent formatting:- Prettier: JavaScript, TypeScript, CSS, JSON, Markdown
- Rustfmt: Rust code
- Taplo: TOML files
Linting
We use ESLint with strict rules:TypeScript Guidelines
Type Safety
Always use explicit types, avoidany:
Type Inference
Use type inference where obvious:Strict Null Checks
Handle null/undefined explicitly:Generics
Use generics for reusable type-safe code:React Guidelines
Component Structure
Hooks
Follow React hooks rules:State Management
Use Jotai for global state:Naming Conventions
Variables & Functions
Files & Folders
Booleans
Use clear boolean naming:Comments
When to Comment
JSDoc for Public APIs
Error Handling
Throw Meaningful Errors
Handle Errors Gracefully
Performance
Avoid Unnecessary Re-renders
Lazy Loading
Security
Sanitize User Input
Validate Input
Protect Sensitive Data
Git Workflow
Commit Messages
Follow Conventional Commits:Branch Naming
Pull Requests
Good PR:- Clear title and description
- Linked to issue
- Small, focused changes
- Tests included
- Documentation updated
Code Review
As a Reviewer
- Be respectful and constructive
- Focus on code, not the person
- Explain your suggestions
- Approve when ready, don’t nitpick
As an Author
- Respond to all comments
- Don’t take feedback personally
- Ask questions if unclear
- Update and re-request review