mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-09 11:55:53 +00:00
- Keep parallel execution for read-only checks (format:check, lint, typecheck) - Make check:fix run sequentially to prevent file write conflicts - Add documentation explaining why sequential execution is needed - Based on best practices: lint-staged and JavaScript community recommendations
2.2 KiB
2.2 KiB
Development Guide
Code Quality Tools
VibeTunnel uses several tools to maintain code quality:
Running All Checks
To run all code quality checks (read-only checks run in parallel):
pnpm run check
This runs format checking, linting, and type checking in parallel and reports any issues.
Individual Tools
Formatting (Biome):
pnpm run format # Fix formatting issues
pnpm run format:check # Check formatting without fixing
Linting (Biome + TypeScript):
pnpm run lint # Check for lint errors
pnpm run lint:fix # Fix auto-fixable lint errors
Type Checking (TypeScript):
pnpm run typecheck # Run type checking on all configs
Auto-fix All Issues
To automatically fix all formatting and linting issues:
pnpm run check:fix
This runs format and lint:fix sequentially to avoid file conflicts.
Why Sequential Fixes?
Running multiple file-modifying tools in parallel can cause race conditions where:
- Both tools try to write to the same file simultaneously
- One tool's changes get overwritten by another
- Git operations fail due to file locks
Best practices from the JavaScript community recommend:
- Parallel for checks: Read-only operations can run simultaneously
- Sequential for fixes: File modifications should happen one after another
- Biome as unified tool: Reduces conflicts by combining formatting and linting
Why Multiple Tools?
- Biome: Fast, modern formatter and linter for JavaScript/TypeScript
- TypeScript: Type checking across server, client, and service worker contexts
- Parallel execution: Saves time by running independent checks simultaneously
Tips for Faster Development
- Use
pnpm run checkbefore committing - Catches all issues at once - Enable format-on-save in your editor - Prevents formatting issues
- Run
pnpm run check:fixto quickly fix issues - Handles problems sequentially
Continuous Development
When developing, you typically want:
# Terminal 1: Run the dev server
pnpm run dev
# Terminal 2: Run tests in watch mode (when needed)
pnpm test
# Before committing: Run all checks
pnpm run check