Back to Audits
Code & Testing
Is this maintainable?
Review coding standards, test coverage, and dependency health. Maintainable code scales; messy code creates debt.
Stage expectations
POC
Skip
Lint passes, that's enough
Tests are optional
Speed over quality
MVP
Light
Happy path tests exist
No critical vulnerabilities
Basic structure established
MMP
Full
Good test coverage
Tech debt documented
Dependencies audited
PROD
Complete
High coverage on critical paths
Dependencies current and secure
Debt actively managed
Linting & Formatting
POC+- ESLint passes with no errors
- Prettier formatting applied consistently
- No disabled linting rules without justification
- Lint runs in CI on every PR
- Pre-commit hooks enforce linting
- Editor settings match project config
TypeScript Quality
MVP+- TypeScript strict mode enabled
- No use of 'any' without explicit justification
- Proper types for API responses
- Shared types in dedicated files
- Enums or const objects for fixed values
- Generics used appropriately for reusable code
- No ts-ignore comments without explanation
Naming Conventions
MVP+- PascalCase for components and types
- camelCase for variables and functions
- SCREAMING_SNAKE_CASE for constants
- kebab-case for file names
- Descriptive names (not single letters except loops)
- Boolean variables start with is/has/should
- Event handlers prefixed with handle or on
File Structure
MVP+- Files organized by feature or route
- Components in appropriate folders (core, ui, shared)
- Imports organized (external, internal, relative)
- Barrel exports where appropriate
- No circular dependencies
- Related files colocated together
Code Organization
MMP+- Functions small and focused (single responsibility)
- No deeply nested conditionals
- Complex logic extracted to utility functions
- Comments explain WHY, not WHAT
- No commented-out code left in codebase
- Magic numbers replaced with named constants
Common Issues & Quick Fixes
ESLint errors ignored in CI: Make lint failure block PR merges
TypeScript 'any' scattered throughout: Gradually type with unknown or proper types
Inconsistent naming: Document conventions in CONTRIBUTING.md, enforce with lint rules
Console.log statements in production: Add no-console lint rule, use proper logging
Circular dependencies causing bugs: Use madge or circular-dependency-plugin to detect
Quick Commands
Linting & Formatting
- pnpm lint
- pnpm format --check
- npx tsc --noEmit
Dependencies
- npm audit
- npx depcheck
- npx npm-check-updates
Tools & Resources
Testing Frameworks
- Vitest — Fast unit testing for Vite/Next.js
- Playwright — Cross-browser E2E testing
- Testing Library — User-centric component testing
- MSW — API mocking for tests
Code Quality
- ESLint — Pluggable JavaScript linter
- Prettier — Code formatter
- TypeScript ESLint — TypeScript linting rules
- Husky — Git hooks for linting
Dependency Management
- Dependabot — Automated dependency updates
- Socket — Supply chain security
- depcheck — Find unused dependencies
- knip — Find unused files and dependencies
Code Analysis
- SonarCloud — Code quality and security
- CodeClimate — Maintainability analysis
- ts-prune — Find unused TypeScript exports
- madge — Circular dependency detection
AI Agent Commands
Use these prompts with your AI coding agent to check code quality:
Run the Code & Testing audit at MVP levelFind files missing test coverageCheck for TypeScript any usageFind TODO comments without linked issuesAudit dependencies for security vulnerabilities