1.6 KiB
1.6 KiB
name, description
| name | description |
|---|---|
| code-review | Frontend code review checklist for React, TypeScript, and Tailwind |
Frontend Code Review
Review recently changed files against this checklist.
Process
-
Identify Changed Files
- Run
git diff --name-onlyto find modified files - Focus on
.tsx,.tsfiles insrc/
- Run
-
Review Each File
TypeScript
- No
anytypes (use proper types orunknown) - Interfaces for component props
- No unused imports or variables
- Proper error handling (no silent catches)
React Patterns
"use client"only when needed (hooks, events, browser APIs)- No unnecessary
React.memo - Stable callbacks with
useCallbackwhen passed as props - Cleanup in
useEffect(event listeners, subscriptions, GSAP) - Keys on mapped elements (not index unless static list)
Component Structure
- Logic extracted to hooks (if complex)
- Props interface defined
- Default export at bottom
Tailwind/Styling
- Using
cls()for conditional classes - Responsive classes (mobile-first)
- No hardcoded colors (use CSS variables)
- Proper z-index layering
Performance
- Images use
next/imagewith proper sizing - Heavy components use dynamic import if below fold
- No unnecessary re-renders (check deps arrays)
Accessibility
- Interactive elements are focusable
- Images have alt text
- Buttons have accessible names
aria-hiddenon decorative elements
- Report Findings
- List issues grouped by severity: Critical, Warning, Suggestion
- Provide specific line numbers and fixes