PR ReviewFrontend Review

Frontend Review Guidelines

End-to-end frontend code review process and guidelines

👤 Milind Naik📅 Updated: Feb 2, 2026📁 Code Review Guidelines🏷️ frontend🏷️ code-review🏷️ react🏷️ typescript

Frontend Code Review Guidelines

Complete end-to-end code review process for frontend development, covering developer responsibilities before raising a PR and reviewer expectations during review.


Part 1: Developer Guidelines (Before Creating PR)

1. Self-Review Responsibilities

Before creating a PR, frontend developers must self-review their changes to ensure correctness, readability, performance, and long-term maintainability.

Mandatory Self-Review Checklist

#CheckWhat to Verify
1Code readabilityLogic is easy to follow and well structured
2Naming clarityComponents, hooks, variables, and functions are meaningful
3No dead codeRemove unused imports, commented code, console logs
4Single responsibilityComponents/hooks do one thing only
5ReusabilityCommon logic extracted into utility/helper functions or hooks
6Error handlingAPI failures and edge cases handled
7UI statesLoading, error, empty, and success/failure states covered
8Type safetyTypes should be clear, consistent, and appropriate for the use case

2. Code Quality Guidelines

General Standards

  • Use TypeScript strictly
  • Avoid any,JsonObject unless explicitly justified
  • Follow camelCase for variables/functions
  • Use PascalCase for components
  • Avoid deeply nested conditionals and JSX
  • Prefer early returns over complex branching
  • Keep files focused; split large components

React Guidelines

  • Prefer functional components
  • Keep components small and focused
  • Avoid unnecessary or duplicate useEffect hooks
  • Ensure useEffect dependency arrays are correct
  • Memoization (useMemo, useCallback) only when required
  • Avoid deeply nested JSX; extract subcomponents when needed
  • Use key attribute when rendering lists

State Management

  • Prefer local state over global state
  • Avoid duplicated or derived state
  • Keep reducers pure and predictable
  • Do not perform heavy transformations inside JSX

3. Performance & UX Guidelines

AreaExpectations
RenderingAvoid unnecessary re-renders
ListsAlways use stable keys (avoid index where data changes)
Expensive logicMemoize when justified
API callsNo duplicate or parallel calls without reason
UX feedbackLoaders, disabled states, or skeletons provided

4. Security & Safety Guidelines

  • Avoid exposing secrets, tokens, or sensitive internal identifiers in the UI where possible
  • Perform basic validation of user inputs before submitting requests (required fields, format checks)
  • Do not rely solely on backend responses for simple input correctness or user feedback
  • Be cautious when rendering dynamic or user-provided content

Part 2: PR Review Guidelines (Reviewer Responsibilities)

Category 1: Code Quality (Blocking)

CheckExpectation
✅ Clear namingNo vague or misleading names
✅ Readable JSXJSX not deeply nested or cluttered
✅ Clean codeNo unused imports or variables
✅ Proper typingTypes are meaningful and correct
✅ FormattingMatches project conventions
✅ No debug artifactsNo console.log or debugger statements. console.warn / console.error allowed only for intentional, meaningful logging (e.g. third-party integrations or complex API flows).

Category 2: Architecture & Patterns (Blocking)

CheckExpectation
✅ Component responsibilityComponents are not overloaded
✅ Separation of concernsUI, logic, and data clearly separated
✅ Folder structureFiles placed in correct domains
✅ API abstractionNo API calls directly inside JSX

Category 3: Performance (Blocking for High Impact)

CheckExpectation
✅ Re-render controlProps/state usage reviewed
✅ MemoizationUsed only where beneficial
✅ List efficiencyStable keys and optimized rendering
✅ Effects correctnessNo missing or excessive dependencies

Category 4: UX & Accessibility (Blocking for User-Facing Changes)

CheckExpectation
✅ Loading statesClear feedback during async actions
✅ Error statesHelpful and actionable messages
✅ Empty statesGraceful handling of no data
✅ Visual consistencyMatches existing UI/design system

Category 5: Security (Blocking)

CheckExpectation
✅ No secrets exposedTokens, keys, internal data hidden
✅ Input safetyInputs handled defensively
✅ Auth boundariesFrontend does not bypass auth

On this page