Precommit Check
Overview
Format changed files, then run typecheck and build. Treat warnings as non-blocking unless a command exits nonzero.
Workflow
- •
Confirm you are in the repo root and git is available.
- •
Format changed files with Prettier:
bashaffected=$(git diff --name-only --diff-filter=ACM) if [ -n "$affected" ]; then git diff --name-only --diff-filter=ACM -z | xargs -0 npx prettier --write --ignore-unknown --log-level warn -- fi
- •
Run typecheck:
npm run typecheck. - •
Run build:
npm run build. - •
Report results:
- •Fail on any nonzero exit code.
- •Ignore warnings that do not affect logic, but mention them if they appear in output.