Add precommit command for web app

This commit is contained in:
Jeff Hurray 2025-06-30 21:49:16 -10:00 committed by Peter Steinberger
parent 7662822e10
commit f16536a823
3 changed files with 16 additions and 8 deletions

View file

@ -112,17 +112,21 @@ swiftlint
### TypeScript/JavaScript Code
- **ESLint**: For code quality checks
- **Prettier**: For consistent formatting
- **Biome**: For code formatting and linting (replaces ESLint + Prettier)
- **TypeScript**: Strict mode enabled
Run before committing:
```bash
cd web
pnpm run format # Format with Prettier
pnpm run lint # Check with ESLint
pnpm run lint:fix # Auto-fix ESLint issues
pnpm run typecheck # Check TypeScript types
pnpm run precommit # Runs format + lint fixes + typecheck in one command
```
Or run individually if needed:
```bash
pnpm run format # Format with Biome
pnpm run lint # Check with Biome + TypeScript
pnpm run lint:fix # Auto-fix Biome issues
pnpm run typecheck # Check TypeScript types only
```
### Important Rules
@ -212,7 +216,7 @@ pnpm run test
4. **Commit your changes**
```bash
# Web changes
cd web && pnpm run lint:fix && pnpm run typecheck
cd web && pnpm run precommit
# Swift changes
cd mac && swiftformat . && swiftlint

View file

@ -3,7 +3,10 @@
"allow": [
"Bash(git -C .. pull)",
"Bash(rg:*)",
"Bash(grep:*)"
"Bash(grep:*)",
"Bash(pnpm run format:*)",
"Bash(pnpm run lint:*)",
"Bash(pnpm run precommit)"
],
"deny": []
}

View file

@ -33,6 +33,7 @@
"prettier:fast": "PRETTIER_EXPERIMENTAL_CLI=1 prettier --write src",
"check": "./scripts/check-all.sh",
"check:fix": "./scripts/check-fix-sequential.sh",
"precommit": "npm run format && npm run lint:fix && npm run typecheck",
"test:e2e": "playwright test",
"test:e2e:headed": "playwright test --headed",
"test:e2e:debug": "playwright test --debug",