Pre-Commit Workflow
Overview
Before committing any changes, all three checks MUST pass. The same checks run in GitHub Actions CI, so failing locally means failing in CI.
Quick Command
bash
bun run lint:fix && bun run typecheck && bun testRequired Checks
1. Lint (Biome)
Biome handles both linting and formatting:
bash
bun run lint # Check only — shows errors without fixing
bun run lint:fix # Auto-fix fixable issuesConfiguration is in biome.jsonc at the root.
2. TypeScript Check
Verify type safety across the entire monorepo:
bash
bun run typecheck3. Tests
Run all tests:
bash
bun test # All tests
bun test packages/cex-wallets # Specific package
bun test --watch # Watch modeCI Workflows
GitHub Actions runs the same three checks automatically on every push and PR. Never merge code that fails any check.
Common Issues
Biome formatting
If lint:fix doesn't fix everything, check for complex cases manually. Single quotes, 100-character line width, 2-space indentation.
TypeScript errors after adding new files
Ensure new packages are included in tsconfig.json references at the root.
Tests failing due to missing mocks
Use as unknown as InterfaceType when casting mock objects to avoid TypeScript complaints while keeping type safety at the mock boundary.
