This document defines the code review process and standards for the FlickJS monorepo. All pull requests require at least one approving review before merging.
Code review exists to:
- Catch bugs early - Identify issues, edge cases, and potential runtime errors before they reach users
- Ensure correctness - Verify that code does what it claims to do, with proper handling of error cases
- Maintain quality - Keep the codebase readable, maintainable, and consistent with existing patterns
- Share knowledge - Help team members understand changes and learn from one another
- Improve security - Identify vulnerabilities, unsafe practices, and compliance issues
- Prevent regressions - Catch unintended side effects and breaking changes
- Logic is sound: Does the code do what the PR description claims? Are edge cases handled?
- No obvious bugs: Look for off-by-one errors, null/undefined checks, type mismatches, and logical fallacies
- Error handling: Are error cases explicitly handled? Do promises reject/throw appropriately?
- State management: Are state updates consistent? Is immutability respected where required?
- Clear naming: Are variables, functions, and classes named descriptively?
- Code structure: Is the code organized logically? Are functions/components a reasonable size?
- Existing patterns: Does the code follow established patterns in the codebase? Are there unnecessary deviations?
- Complexity: Is the code overcomplicated? Can it be simplified without loss of clarity?
- Test coverage: Are new functions/components tested? Do tests cover the happy path and error cases?
- Test quality: Do tests verify behavior, not implementation? Are they maintainable?
- No skipped tests: Flag any
.skip()or.only()left in the code
- Type safety: Are types defined accurately? Avoid
any,unknownwithout justification - Consistency: Do types align with the rest of the codebase? Are generics used appropriately?
- No type suppression: Flag
@ts-ignorecomments without explanation
- API documentation: Are public functions/components documented? Do JSDoc comments add value?
- Complex logic: Is non-obvious logic explained in comments?
- README updates: Does documentation reflect the changes?
- No secrets: Check for hardcoded API keys, tokens, or credentials
- Input validation: User input, external data, and untrusted sources validated appropriately
- Dependency safety: New dependencies reviewed for known vulnerabilities
- XSS/Injection: Template strings, DOM manipulation, and dynamic code generation reviewed for safety
- Performance regressions: Are there unnecessary re-renders, loops, or expensive operations?
- Accessibility: Do UI changes maintain or improve accessibility? (headings, labels, ARIA, keyboard nav)
- Bundle impact: Do changes increase bundle size significantly? (especially in shared libraries)
- Scope clarity: Does the change do one thing well, or does it mix concerns?
- Backwards compatibility: Are breaking changes intentional and documented?
- Related files: Has the reviewer checked related files for consistency?
- ✅ "Consider using a Set here for O(1) lookup instead of linear search"
- ❌ "This is inefficient"
- ✅ "The
timeouterror isn't caught in thefetchUser()call on line 42" - ❌ "Error handling needs work"
Use clear language:
- Must-fix: "This will cause a runtime error because..."
- Should-consider: "We could improve this by..."
- Nice-to-have: "Future improvement: consider..."
- Use questions to encourage thought: "What happens if the API returns null here?"
- Assume good intent: "I'm not familiar with this pattern—can you explain how it works?"
Comment on the code, not the author. Focus on what can be improved, not who wrote it.
Approve a PR when:
- ✅ No critical correctness issues that would cause runtime errors
- ✅ No unaddressed security vulnerabilities
- ✅ Tests added for new functionality; existing tests pass
- ✅ Code follows established patterns; deviations are justified
- ✅ Types are accurate; no unwarranted
anyusage - ✅ No obvious performance regressions
- ✅ Feedback has been addressed (must-fix issues resolved, no outstanding blockers)
Request changes when:
- ❌ Logic errors or edge cases not handled
- ❌ Tests missing or failing
- ❌ New dependencies introduced without justification
- ❌ Security or accessibility regressions
- ❌ Breaking changes not documented or discussed
Use this checklist as a starting point. Adapt based on package type and change scope.
- Read the PR description and understand the intent
- Check if this is a breaking change
- Review the diff and related files
- Logic is sound and handles edge cases
- Error cases are handled explicitly
- No obvious null/undefined issues
- State updates are consistent
- Code follows existing patterns
- Names are clear and descriptive
- Functions/components are reasonably sized
- No unnecessary complexity
- Types are accurate (no loose
anyusage) - New code has test coverage
- Tests verify behavior, not implementation
- No skipped or debug tests
- No hardcoded secrets or credentials
- Input validation appropriate
- No obvious performance regressions
- Accessibility maintained (for UI changes)
- Documentation/README updated if needed
- All feedback addressed
- Approve or request changes
- Reactivity is correct: Fine-grained updates only affect intended DOM nodes
- Memory efficiency: No leaks in effect cleanup or signal subscriptions
- API stability: Changes to public API require discussion
- Babel plugin correctness: Transformations produce valid JavaScript
- Edge cases: JSX edge cases (fragments, conditional rendering, lists) handled
- Error messages: Compilation errors are clear and actionable
- User experience: CLI output is clear; landing site is performant
- Accessibility: Forms, buttons, and navigation are accessible
- Responsive design: Mobile and desktop layouts work well
- Does behavior remain identical?
- Are tests passing without modification?
- Is the new structure clearer than the old?
- Include before/after metrics where possible
- Check for regressions in other areas
- Consider readability trade-offs
- Is the feature necessary and well-scoped?
- Is the API intuitive?
- Is there a clear use case?
If you're unsure whether feedback is appropriate, default to asking politely. If you disagree with feedback, discuss it in the PR or in sync. The goal is a better codebase, not winning arguments.