Description
The CI pipeline lacks a TypeScript type-check step (tsc --noEmit) and a Prettier formatting check. Type errors only surface during build, and formatting inconsistencies slip into the codebase silently. Both checks must be added as early CI gates that run on every pull request before the test suite, to catch issues cheaply.
Requirements and context
- Add a
typecheck script in package.json that runs tsc --noEmit --project tsconfig.json
- Add a
format:check script that runs prettier --check "src/**/*.ts" "tests/**/*.ts"
- Add corresponding CI steps in the workflow file (
.github/workflows/ci.yml) running before pnpm test
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested execution
Fork the repo and create a branch
git checkout -b feature/ci-typecheck-prettier
Implement changes
- Update/Write:
package.json — add typecheck and format:check scripts
- Update/Write:
.github/workflows/ci.yml — add typecheck and format-check steps
- Update/Write:
.prettierrc — confirm or create Prettier config consistent with existing style
- Write comprehensive tests: N/A (CI configuration change; validate by triggering workflow)
- Add documentation:
CONTRIBUTING.md — document how to run type-check and format-check locally
- Include clear code comments and types
- Validate security assumptions
Test and commit
- Run tests:
pnpm test (or pnpm test:coverage)
- Cover edge cases: intentional type error caught by typecheck, intentional format violation caught by format:check, both pass on clean codebase
- Include test output and security notes
Example commit message
ci: add tsc --noEmit type-check and Prettier format-check gates
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
The CI pipeline lacks a TypeScript type-check step (
tsc --noEmit) and a Prettier formatting check. Type errors only surface during build, and formatting inconsistencies slip into the codebase silently. Both checks must be added as early CI gates that run on every pull request before the test suite, to catch issues cheaply.Requirements and context
typecheckscript inpackage.jsonthat runstsc --noEmit --project tsconfig.jsonformat:checkscript that runsprettier --check "src/**/*.ts" "tests/**/*.ts".github/workflows/ci.yml) running beforepnpm testSuggested execution
Fork the repo and create a branch
Implement changes
package.json— addtypecheckandformat:checkscripts.github/workflows/ci.yml— add typecheck and format-check steps.prettierrc— confirm or create Prettier config consistent with existing styleCONTRIBUTING.md— document how to run type-check and format-check locallyTest and commit
pnpm test(orpnpm test:coverage)Example commit message
Guidelines