Phase 12 prerequisite. `exclude` still carried `src/components/ui`, `src/api` and `src/lib` from `jsconfig.json`; each was meant to come off as its tree was converted, in Phases 4, 5 and 6, and all three were missed. The miss was quiet by construction. Excluding a file only keeps it out of the ROOT set — anything an included file imports is pulled in anyway — so 318 of 321 files were being checked regardless, and the omission cost nothing visible. The three that were not checked are the ones nothing under `src` imports: `api/seed.ts`, `api/attendanceSeed.ts` and `lib/skills/positionFlow.ts`. They are not dead code. `scripts/` loads them, `seed.ts` from six separate places, and they held four real errors that no previous count in this migration has included. All four were one cause. `MODULE_TABLE` is 36 rows of mixed literals, so it infers as an array of the UNION of its column types and destructuring a row gives every field `string | number | string[]` — `SKILL_CATEGORY[skill_id]` then refuses a key that might be an array. It is now written as the tuple it is. The migration plan predicted this class of error for three other tables by name. Doing this before the ratchet rather than after: a strictness flag measured against an incomplete root set produces a number that grows again later for reasons unrelated to the flag, and the whole method here is that each step's error count means one thing. root set 321 files, was 318 typecheck 0 errors, with every file in src now checked lint exit 0 npm test 1684/1691, the same 7 failures build exit 0, identical bundle hash 74d17e2d… seed.ts emitted JS identical `allowJs`, `checkJs` and `jsconfig.json` are deliberately left alone — they come off at final cleanup, after strictness. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBG1wnuRfJKCstGB8Fekr8
90 lines
4.2 KiB
JSON
90 lines
4.2 KiB
JSON
{
|
|
/* The TypeScript configuration, succeeding `jsconfig.json`.
|
|
Deliberately a translation of what was already there rather than a fresh
|
|
start: every option below that existed in jsconfig carries its old value,
|
|
so the first day of the migration checks exactly what the last day before
|
|
it checked. The four additions are marked.
|
|
|
|
`jsconfig.json` is left in place for now and is inert — TypeScript ignores
|
|
it wherever a `tsconfig.json` sits beside it. It is removed in the final
|
|
phase, once nothing is asking for it. */
|
|
"compilerOptions": {
|
|
"baseUrl": ".",
|
|
"paths": {
|
|
"@/*": ["./src/*"]
|
|
},
|
|
"jsx": "react-jsx",
|
|
"module": "esnext",
|
|
"moduleResolution": "bundler",
|
|
"lib": ["esnext", "dom", "dom.iterable"],
|
|
"target": "esnext",
|
|
|
|
/* Vite builds; this config only ever checks. Stating it means no stray
|
|
output can appear next to a source file if anyone runs `tsc` directly. */
|
|
"noEmit": true,
|
|
|
|
/* The two that make an incremental migration possible. `allowJs` lets a
|
|
`.ts` file and a `.js` file import each other with no ceremony, so files
|
|
can be converted one at a time instead of in one unreviewable commit;
|
|
`checkJs` keeps the JSDoc-typed JavaScript under the same scrutiny it
|
|
has had all along, so nothing is lost in the meantime. Both go away at
|
|
the end of the migration, not before. */
|
|
"allowJs": true,
|
|
"checkJs": true,
|
|
|
|
/* NEW. esbuild compiles each file on its own and cannot see across them, so
|
|
a construct that needs whole-program knowledge — re-exporting a type as
|
|
if it were a value, most often — works under `tsc` and breaks in the
|
|
bundle. This makes tsc refuse what esbuild could not have done anyway. */
|
|
"isolatedModules": true,
|
|
|
|
/* NEW. macOS does not distinguish `Button` from `button`; CI does. Without
|
|
this, a mis-cased import is a green local build and a red pipeline. */
|
|
"forceConsistentCasingInFileNames": true,
|
|
|
|
"skipLibCheck": true,
|
|
"allowSyntheticDefaultImports": true,
|
|
"esModuleInterop": true,
|
|
"resolveJsonModule": true,
|
|
|
|
/* CHANGED, from `[]`. The empty list suppressed every ambient type package,
|
|
which is why `import.meta.env` and `import.meta.glob` — Vite build-time
|
|
APIs, absent from the standard `ImportMeta` — were reported as errors in
|
|
eight places across the app.
|
|
|
|
Named explicitly rather than left to default, because the default pulls
|
|
in EVERYTHING under node_modules/@types, and `@types/node` is installed.
|
|
In browser code that would make `setTimeout` return a `NodeJS.Timeout`
|
|
instead of a number, which is wrong and quietly infectious: three
|
|
components store a timer handle in a `useRef` and would be typed against
|
|
a runtime they do not run on. Node's types belong to `vite.config.js` and
|
|
`scripts/`, neither of which this project includes. */
|
|
"types": ["vite/client"],
|
|
|
|
/* Off for now, and turned on a flag at a time later in the migration —
|
|
`noImplicitAny`, then `strictNullChecks`, then the rest. Enabling it here
|
|
would bury the ~70 real errors this project already has under several
|
|
hundred more, and the point of going file by file is that each step is
|
|
small enough to read. */
|
|
"strict": false
|
|
},
|
|
|
|
"include": ["src/**/*"],
|
|
|
|
/* `src/components/ui`, `src/api` and `src/lib` used to be listed here, from
|
|
jsconfig, and each was meant to come off as its tree was converted. They
|
|
were missed, and the miss was quiet by construction: excluding a file only
|
|
keeps it out of the ROOT set, and anything an included file imports is
|
|
pulled in anyway, so 318 of the 321 files were being checked regardless.
|
|
|
|
The three that were not are the ones nothing under `src` imports —
|
|
`api/seed.ts`, `api/attendanceSeed.ts` and `lib/skills/positionFlow.ts`.
|
|
They are not dead: `scripts/` loads them, `seed.ts` from six places. They
|
|
were simply invisible to `tsc`, and held four real errors.
|
|
|
|
Removed before the strictness ratchet rather than after, because a flag
|
|
measured against an incomplete root set gives a number that grows again
|
|
later for reasons that have nothing to do with the flag. */
|
|
"exclude": ["node_modules", "dist"]
|
|
}
|