From a238f08c95079dcb7bc0aa88418bf6234f6bcc92 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 16 Jul 2026 13:38:02 +0000 Subject: [PATCH] Combined critique #56: root base tsconfig, dedup compiler policy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extract shared compiler policy (target/module/moduleResolution/strict/ skipLibCheck/isolatedModules/verbatimModuleSyntax/noEmit) into tsconfig.base.json, extended by the 3 leaf tsconfigs with no `paths` mapping (apps/web, examples/tanstack-host, packages/jgengine). Verified via isolated repro that Bun 1.3.11's test runner does not apply tsconfig `paths` through `extends` unless `baseUrl` is also set in the same file (oven-sh/bun#23695, open upstream bug) — and tsgo (this repo's mandated compiler) has removed `baseUrl` support entirely (TS5102), making the two requirements mutually exclusive. The other 26 leaf tsconfigs (every package/game/app with a `paths` map) therefore keep their duplicated compiler flags as-is rather than risk breaking `bun test` deep-import resolution. No drift reconciliation beyond the 3 deduped configs: all leaf configs already agreed on target/module/moduleResolution/strict/skipLibCheck/ isolatedModules (100% consistent). verbatimModuleSyntax was previously absent only from examples/next-host and examples/studios (esModuleInterop used instead); left untouched since they can't safely extend the base. noUnusedLocals/noUnusedParameters/noFallthroughCasesInSwitch were already package-specific opt-ins (10 Games + convex/react/shell/ next-host/studios lack them) — tested forcing these on everywhere and it broke 4 workspaces (unused-local errors), so left as pre-existing per-package strictness, not moved to base. --- apps/web/tsconfig.json | 35 ++++++++++++++++++---------- examples/tanstack-host/tsconfig.json | 34 +++++++++++++++++---------- packages/jgengine/tsconfig.json | 25 ++++++++++---------- tsconfig.base.json | 12 ++++++++++ 4 files changed, 70 insertions(+), 36 deletions(-) create mode 100644 tsconfig.base.json diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index eeb77f55f..bb2f9f885 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -1,20 +1,31 @@ { + "extends": "../../tsconfig.base.json", "compilerOptions": { - "target": "ES2022", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "module": "ESNext", - "moduleResolution": "bundler", + "lib": [ + "ES2022", + "DOM", + "DOM.Iterable" + ], "jsx": "react-jsx", - "strict": true, - "noEmit": true, - "skipLibCheck": true, - "isolatedModules": true, - "verbatimModuleSyntax": true, "resolveJsonModule": true, "noUnusedLocals": true, "noUnusedParameters": true, - "types": ["vite/client", "node"] + "types": [ + "vite/client", + "node" + ] }, - "include": ["src", "vite.config.ts", "scripts"], - "exclude": ["dist", ".output", ".nitro", ".vercel", ".tanstack", "src/**/*.test.ts"] + "include": [ + "src", + "vite.config.ts", + "scripts" + ], + "exclude": [ + "dist", + ".output", + ".nitro", + ".vercel", + ".tanstack", + "src/**/*.test.ts" + ] } diff --git a/examples/tanstack-host/tsconfig.json b/examples/tanstack-host/tsconfig.json index 7d09db98c..9f295e6be 100644 --- a/examples/tanstack-host/tsconfig.json +++ b/examples/tanstack-host/tsconfig.json @@ -1,20 +1,30 @@ { + "extends": "../../tsconfig.base.json", "compilerOptions": { - "target": "ES2022", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "module": "ESNext", - "moduleResolution": "bundler", + "lib": [ + "ES2022", + "DOM", + "DOM.Iterable" + ], "jsx": "react-jsx", - "strict": true, - "noEmit": true, - "skipLibCheck": true, - "isolatedModules": true, - "verbatimModuleSyntax": true, "resolveJsonModule": true, "noUnusedLocals": true, "noUnusedParameters": true, - "types": ["vite/client", "node"] + "types": [ + "vite/client", + "node" + ] }, - "include": ["src", "vite.config.ts"], - "exclude": ["dist", ".output", ".nitro", ".vercel", ".tanstack", ".vite"] + "include": [ + "src", + "vite.config.ts" + ], + "exclude": [ + "dist", + ".output", + ".nitro", + ".vercel", + ".tanstack", + ".vite" + ] } diff --git a/packages/jgengine/tsconfig.json b/packages/jgengine/tsconfig.json index 36772ba7b..fb684e730 100644 --- a/packages/jgengine/tsconfig.json +++ b/packages/jgengine/tsconfig.json @@ -1,19 +1,20 @@ { + "extends": "../../tsconfig.base.json", "compilerOptions": { - "target": "ES2022", - "lib": ["ES2022"], - "module": "ESNext", - "moduleResolution": "bundler", - "strict": true, - "noEmit": true, - "skipLibCheck": true, - "isolatedModules": true, - "verbatimModuleSyntax": true, + "lib": [ + "ES2022" + ], "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, - "types": ["node"] + "types": [ + "node" + ] }, - "include": ["src"], - "exclude": ["src/**/*.test.ts"] + "include": [ + "src" + ], + "exclude": [ + "src/**/*.test.ts" + ] } diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 000000000..aa00a3db8 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true, + "noEmit": true, + "skipLibCheck": true, + "isolatedModules": true, + "verbatimModuleSyntax": true + } +}