Part 17 / Topic 8 of 8
A local merge gate: lint + typecheck + test
A "typecheck": "tsc --noEmit" script was added alongside the existing "lint": "eslint" and the new "test": "vitest run". Run together, in this order, against this exact harness after every change in this part:
$ npm run lint
> [email protected] lint
> eslint
(no output — 0 problems)
$ npm run typecheck
> [email protected] typecheck
> tsc --noEmit
(no output — 0 errors)
$ npm run test
Test Files 3 passed (3)
Tests 10 passed (10)
$ npm run build
...
Route (app) ... (full table — Part 16's existing routes, unchanged; .test.ts/.test.tsx
files are never picked up as routes by Next's file-system router, confirmed
by checking this exact table for a "test" entry — there is none)
Three independent, fast, local commands, all clean. A merge gate is just "a human (for now) refuses to merge unless all three of these exit 0" — wiring that into an actual CI workflow with branch protection is a natural next step this course leaves to you, not built here.
Done here? The practice set for Part 17 — including the solutions — is on the part page.