chore(backend): type-check prisma scripts via split tsconfig
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"description": "EME — Emprunt Matériel ENSUP — API REST",
|
||||
"main": "dist/app.js",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"build": "tsc -p tsconfig.build.json",
|
||||
"start": "node dist/app.js",
|
||||
"dev": "nodemon --exec ts-node src/app.ts",
|
||||
"prisma:generate": "prisma generate",
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": false,
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist"
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
@@ -2,16 +2,15 @@
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "commonjs",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
"sourceMap": true,
|
||||
"types": ["node"]
|
||||
"types": ["node"],
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"include": ["src/**/*", "prisma/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +113,11 @@ En terminal interactif (VS Code), `migrate dev` fonctionne normalement (taper `y
|
||||
- Scripts : `lint`, `lint:fix`, `format`, `format:check`.
|
||||
- État : lint vert sur tout le code existant ; formatage appliqué (3 fichiers) ; build OK.
|
||||
|
||||
### Étape 13 — Correctif tooling : type-check des scripts Prisma
|
||||
- Problème : `prisma/seed.ts` et `fixtures.ts` étaient hors du `include` du tsconfig ; l'IDE ne chargeait pas les types Node (`process` non reconnu, 2 erreurs).
|
||||
- Correctif : `tsconfig.json` élargi à `src` + `prisma` en `noEmit` (IDE et `tsc --noEmit`) ; nouveau `tsconfig.build.json` dédié à la compilation `src` -> `dist` (`npm run build`).
|
||||
- Bénéfice : les scripts Prisma sont désormais type-checkés (angle mort comblé).
|
||||
|
||||
---
|
||||
|
||||
## Dette technique en attente
|
||||
@@ -127,4 +132,4 @@ En terminal interactif (VS Code), `migrate dev` fonctionne normalement (taper `y
|
||||
|
||||
---
|
||||
|
||||
*Dernière mise à jour : 2026-06-15 — ESLint + Prettier configurés, Block 1 quasi terminé (reste Swagger).*
|
||||
*Dernière mise à jour : 2026-06-15 — Tooling backend finalisé (ESLint, Prettier, tsconfig split).*
|
||||
|
||||
Reference in New Issue
Block a user