---
description: Code review guidelines for TypeScript projects
---
# Code Review
## Structure
- Check that new files are placed in the correct directory.
- Verify imports are sorted and unused imports are removed.
- Confirm naming conventions match the project style.
## Logic
- Look for off-by-one errors in loops and array access.
- Verify error handling covers all failure paths.
- Check that async operations are awaited.
- Confirm discriminated unions are exhaustively matched.
## Testing
- Every new public function should have a corresponding test.
- Edge cases (empty input, null, boundary values) should be covered.
- Tests should not depend on execution order.
## Style
- Prefer `const` over `let` when the binding is never reassigned.
- Use early returns to reduce nesting.
- Do not comment obvious code.