[IMPORTANT] Tests uitgesloten van TypeScript type-checking #5

Open
opened 2026-08-05 21:11:31 +02:00 by eddy · 0 comments
Owner

Probleem

tsconfig.json:7 bevat:

"exclude": ["tests"]

Dit voorkomt dat tsc --noEmit de testbestanden type-checkt. Als een veld in het Measurement type wordt hernoemd, zullen tests met oude veldnamen niet als compileerfout worden gemarkeerd — ze falen pas tijdens runtime met verwarrende errors.

Oplossing

  1. Verwijder "tests" uit de exclude array in tsconfig.json
  2. Draai npx tsc --noEmit en fix eventuele typefouten in de tests
  3. Optioneel: voeg "typecheck": "tsc --noEmit" toe aan package.json scripts
- "exclude": ["tests"]
+ "exclude": []
## Probleem `tsconfig.json:7` bevat: ```json "exclude": ["tests"] ``` Dit voorkomt dat `tsc --noEmit` de testbestanden type-checkt. Als een veld in het `Measurement` type wordt hernoemd, zullen tests met oude veldnamen niet als compileerfout worden gemarkeerd — ze falen pas tijdens runtime met verwarrende errors. ## Oplossing 1. Verwijder `"tests"` uit de `exclude` array in `tsconfig.json` 2. Draai `npx tsc --noEmit` en fix eventuele typefouten in de tests 3. Optioneel: voeg `"typecheck": "tsc --noEmit"` toe aan `package.json` scripts ```diff - "exclude": ["tests"] + "exclude": [] ```
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
eddy/weegschaal-app#5
No description provided.