chore(ts-migration): remove the migration-only TypeScript configuration
`src` holds 321 TypeScript files and no JavaScript, so four settings that
existed only to let the two coexist have nothing left to act on. Each was
removed on its own and validated before the next.
allowJs / checkJs Removed together, because they are coupled: `checkJs`
without `allowJs` is TS5052, a configuration error
rather than a code one. Verified first that nothing
under `src` imports a `.js` module. The program still
resolves the same 321 files and still reports 0 errors.
This also closes a door. With `allowJs` on, a `.js`
file added under `src` would be compiled and bundled
silently; now it is a resolution failure, which is the
right outcome for a codebase that has finished
migrating.
jsconfig.json Deleted. It had been inert since `tsconfig.json`
appeared — TypeScript ignores a jsconfig wherever a
tsconfig sits beside it — and it still carried the old
`types: []` and the three stale excludes. A second,
unread copy of the options is an invitation to edit the
wrong file.
components.json `"tsx": false` -> `true`, so `npx shadcn add` emits
TSX. No runtime effect; it would have quietly
reintroduced `.jsx` into a repository that has none.
`README.md` documented `npm run typecheck` as `tsc -p ./jsconfig.json`
with `checkJs`, which named a file that no longer exists. Corrected, along
with a stale assertion count in the same table (835, against 1691 today).
No file under `src` changed, so there is nothing for a per-file emitted-JS
comparison to compare; the bundle hash is the check that matters and it is
unmoved.
typecheck 0 errors, 321 files in the program
lint exit 0
npm test 1684/1691, the same 7 failures
owliver unchanged; baselines still pinned, not recaptured
build exit 0, bundle 74d17e2d… identical
Left in place deliberately, reported rather than removed:
`scripts/ssr-resolve.mjs`. Its own comment says it can go once `src` holds
no `.js`, but that is only half the condition — the 203 literal `.js`
paths inside `skill-check.mjs` would all have to be renamed first, and
that is a large diff against the file that guards this migration.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBG1wnuRfJKCstGB8Fekr8
This commit is contained in:
@@ -179,8 +179,8 @@ Toasts go through `ds/toast` (a wrapper over `react-hot-toast`), rendered by `<H
|
|||||||
| `npm run preview` | Serve the build |
|
| `npm run preview` | Serve the build |
|
||||||
| `npm run lint` | ESLint — currently clean |
|
| `npm run lint` | ESLint — currently clean |
|
||||||
| `npm run lint:fix` | ESLint with `--fix` |
|
| `npm run lint:fix` | ESLint with `--fix` |
|
||||||
| `npm test` | `scripts/skill-check.mjs` — 835 assertions over the skill and agent systems |
|
| `npm test` | `scripts/skill-check.mjs` — 1691 assertions over the skill and agent systems |
|
||||||
| `npm run typecheck` | `tsc -p ./jsconfig.json` with `checkJs` |
|
| `npm run typecheck` | `tsc -p ./tsconfig.json` — 0 errors across 321 TypeScript files |
|
||||||
|
|
||||||
### The test harness
|
### The test harness
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"$schema": "https://ui.shadcn.com/schema.json",
|
"$schema": "https://ui.shadcn.com/schema.json",
|
||||||
"style": "new-york",
|
"style": "new-york",
|
||||||
"rsc": false,
|
"rsc": false,
|
||||||
"tsx": false,
|
"tsx": true,
|
||||||
"tailwind": {
|
"tailwind": {
|
||||||
"config": "tailwind.config.js",
|
"config": "tailwind.config.js",
|
||||||
"css": "src/index.css",
|
"css": "src/index.css",
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"@/*": ["./src/*"]
|
|
||||||
},
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"lib": ["esnext", "dom"],
|
|
||||||
"target": "esnext",
|
|
||||||
"checkJs": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"types": []
|
|
||||||
},
|
|
||||||
"include": ["src/**/*"],
|
|
||||||
"exclude": ["node_modules", "dist", "src/components/ui", "src/api", "src/lib"]
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
{
|
{
|
||||||
/* The TypeScript configuration, succeeding `jsconfig.json`.
|
/* The TypeScript configuration, and now the only one.
|
||||||
Deliberately a translation of what was already there rather than a fresh
|
It began as a translation of `jsconfig.json` so that the first day of the
|
||||||
start: every option below that existed in jsconfig carries its old value,
|
migration checked exactly what the last day before it checked. That file
|
||||||
so the first day of the migration checks exactly what the last day before
|
has been deleted: it was inert from the moment this one appeared, because
|
||||||
it checked. The four additions are marked.
|
TypeScript ignores a jsconfig wherever a tsconfig sits beside it, and
|
||||||
|
keeping a second stale copy of the options invited someone to edit the one
|
||||||
`jsconfig.json` is left in place for now and is inert — TypeScript ignores
|
nothing reads. */
|
||||||
it wherever a `tsconfig.json` sits beside it. It is removed in the final
|
|
||||||
phase, once nothing is asking for it. */
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
@@ -23,14 +21,16 @@
|
|||||||
output can appear next to a source file if anyone runs `tsc` directly. */
|
output can appear next to a source file if anyone runs `tsc` directly. */
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
|
|
||||||
/* The two that make an incremental migration possible. `allowJs` lets a
|
/* `allowJs` and `checkJs` were here for the migration and are gone: `src`
|
||||||
`.ts` file and a `.js` file import each other with no ceremony, so files
|
holds 321 TypeScript files and no JavaScript, and nothing under `src`
|
||||||
can be converted one at a time instead of in one unreviewable commit;
|
imports a `.js` module, so neither option has anything left to act on.
|
||||||
`checkJs` keeps the JSDoc-typed JavaScript under the same scrutiny it
|
They are removed together because they are coupled — `checkJs` without
|
||||||
has had all along, so nothing is lost in the meantime. Both go away at
|
`allowJs` is TS5052, a configuration error rather than a code one.
|
||||||
the end of the migration, not before. */
|
|
||||||
"allowJs": true,
|
Removing them also closes a door. With `allowJs` on, a `.js` file added
|
||||||
"checkJs": true,
|
under `src` would be compiled and bundled silently; now it is a
|
||||||
|
resolution failure, which is the correct outcome for a codebase that has
|
||||||
|
finished migrating. */
|
||||||
|
|
||||||
/* NEW. esbuild compiles each file on its own and cannot see across them, so
|
/* 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
|
a construct that needs whole-program knowledge — re-exporting a type as
|
||||||
@@ -71,8 +71,8 @@
|
|||||||
|
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*"],
|
||||||
|
|
||||||
/* `src/components/ui`, `src/api` and `src/lib` used to be listed here, from
|
/* `src/components/ui`, `src/api` and `src/lib` used to be listed here,
|
||||||
jsconfig, and each was meant to come off as its tree was converted. They
|
inherited from jsconfig, each meant to come off as its tree was converted. They
|
||||||
were missed, and the miss was quiet by construction: excluding a file only
|
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
|
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.
|
pulled in anyway, so 318 of the 321 files were being checked regardless.
|
||||||
|
|||||||
Reference in New Issue
Block a user