From b657500e26a507324c4f93dac9352e14bb3cca0e Mon Sep 17 00:00:00 2001 From: skdthread Date: Tue, 24 Feb 2026 13:13:52 +0100 Subject: [PATCH 1/5] Add tsgo package for faster typecheck --- workspaces/adventure-pack/package.json | 1 + .../adventure-pack/src/app/useAppState.ts | 1 - .../package.json | 1 + workspaces/eslint-config/package.json | 1 + .../fetch-leetcode-problem-list/package.json | 1 + .../package.json | 1 + .../generate-health-report/package.json | 1 + .../javascript-leetcode-month/package.json | 1 + workspaces/leetcode-api/package.json | 1 + .../leetcode-prettier-extension/package.json | 1 + workspaces/leetcode-zen-mode/package.json | 1 + .../package.json | 1 + workspaces/repository-scripts/package.json | 1 + .../repository-scripts/src/typecheck.ts | 2 +- workspaces/simon-game/package.json | 1 + workspaces/util/package.json | 1 + workspaces/util/src/stringToCase.ts | 1 - .../package.json | 1 + .../package.json | 1 + yarn.lock | 97 +++++++++++++++++++ 20 files changed, 114 insertions(+), 3 deletions(-) diff --git a/workspaces/adventure-pack/package.json b/workspaces/adventure-pack/package.json index 863bd8d6..ee770eab 100644 --- a/workspaces/adventure-pack/package.json +++ b/workspaces/adventure-pack/package.json @@ -74,6 +74,7 @@ "@types/react": "18.3.12", "@types/react-dom": "18.3.1", "@types/react-syntax-highlighter": "15.5.13", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "copy-webpack-plugin": "12.0.2", "cross-env": "7.0.3", "eslint": "9.14.0", diff --git a/workspaces/adventure-pack/src/app/useAppState.ts b/workspaces/adventure-pack/src/app/useAppState.ts index b96a7c31..27e5267d 100644 --- a/workspaces/adventure-pack/src/app/useAppState.ts +++ b/workspaces/adventure-pack/src/app/useAppState.ts @@ -70,7 +70,6 @@ function reducer(state: AppState, action: Action): AppState { // @ts-expect-error Unreachable code, switch should be exhaustive. console.error("Unhandled action type:", action); - // @ts-expect-error Unreachable code, switch should be exhaustive. return state; } diff --git a/workspaces/download-leetcode-submissions/package.json b/workspaces/download-leetcode-submissions/package.json index 6654fe92..d2da7081 100644 --- a/workspaces/download-leetcode-submissions/package.json +++ b/workspaces/download-leetcode-submissions/package.json @@ -32,6 +32,7 @@ "@code-chronicles/repository-scripts": "workspace:*", "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "fork-ts-checker-webpack-plugin": "9.0.2", diff --git a/workspaces/eslint-config/package.json b/workspaces/eslint-config/package.json index 6ced01a3..f8c7dce4 100644 --- a/workspaces/eslint-config/package.json +++ b/workspaces/eslint-config/package.json @@ -25,6 +25,7 @@ "@stylistic/eslint-plugin-ts": "2.10.1", "@typescript-eslint/eslint-plugin": "8.13.0", "@typescript-eslint/parser": "8.13.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint-import-resolver-typescript": "3.6.3", "eslint-plugin-import": "2.31.0", "eslint-plugin-import-x": "4.4.0", diff --git a/workspaces/fetch-leetcode-problem-list/package.json b/workspaces/fetch-leetcode-problem-list/package.json index 4c6f691a..1518431f 100644 --- a/workspaces/fetch-leetcode-problem-list/package.json +++ b/workspaces/fetch-leetcode-problem-list/package.json @@ -30,6 +30,7 @@ "@code-chronicles/repository-scripts": "workspace:*", "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "fork-ts-checker-webpack-plugin": "9.0.2", diff --git a/workspaces/fetch-recent-accepted-leetcode-submissions/package.json b/workspaces/fetch-recent-accepted-leetcode-submissions/package.json index a5f9639e..244d9edc 100644 --- a/workspaces/fetch-recent-accepted-leetcode-submissions/package.json +++ b/workspaces/fetch-recent-accepted-leetcode-submissions/package.json @@ -30,6 +30,7 @@ "@code-chronicles/repository-scripts": "workspace:*", "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "fork-ts-checker-webpack-plugin": "9.0.2", diff --git a/workspaces/generate-health-report/package.json b/workspaces/generate-health-report/package.json index 70d7df84..7db8e998 100644 --- a/workspaces/generate-health-report/package.json +++ b/workspaces/generate-health-report/package.json @@ -27,6 +27,7 @@ "devDependencies": { "@code-chronicles/eslint-config": "workspace:*", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "prettier": "3.3.3", "typescript": "5.6.3" diff --git a/workspaces/javascript-leetcode-month/package.json b/workspaces/javascript-leetcode-month/package.json index 8e41570f..550835fc 100644 --- a/workspaces/javascript-leetcode-month/package.json +++ b/workspaces/javascript-leetcode-month/package.json @@ -25,6 +25,7 @@ "@code-chronicles/util": "workspace:*", "@types/mdast": "4.0.4", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "mdast": "3.0.0", "prettier": "3.3.3", diff --git a/workspaces/leetcode-api/package.json b/workspaces/leetcode-api/package.json index c32e0fc3..6f295f9f 100644 --- a/workspaces/leetcode-api/package.json +++ b/workspaces/leetcode-api/package.json @@ -41,6 +41,7 @@ "@graphql-codegen/cli": "5.0.3", "@graphql-codegen/near-operation-file-preset": "3.0.0", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "dedent": "1.5.3", "eslint": "9.14.0", diff --git a/workspaces/leetcode-prettier-extension/package.json b/workspaces/leetcode-prettier-extension/package.json index bca692ff..6449e38f 100644 --- a/workspaces/leetcode-prettier-extension/package.json +++ b/workspaces/leetcode-prettier-extension/package.json @@ -31,6 +31,7 @@ "@code-chronicles/repository-scripts": "workspace:*", "@code-chronicles/webpack-chrome-extension-manifest-plugin": "workspace:*", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "fork-ts-checker-webpack-plugin": "9.0.2", diff --git a/workspaces/leetcode-zen-mode/package.json b/workspaces/leetcode-zen-mode/package.json index ac950b55..e9cc0778 100644 --- a/workspaces/leetcode-zen-mode/package.json +++ b/workspaces/leetcode-zen-mode/package.json @@ -40,6 +40,7 @@ "@types/node": "22.9.0", "@types/react": "18.3.12", "@types/react-dom": "18.3.1", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "fork-ts-checker-webpack-plugin": "9.0.2", diff --git a/workspaces/post-leetcode-potd-to-discord/package.json b/workspaces/post-leetcode-potd-to-discord/package.json index a82527d8..55794a56 100644 --- a/workspaces/post-leetcode-potd-to-discord/package.json +++ b/workspaces/post-leetcode-potd-to-discord/package.json @@ -38,6 +38,7 @@ "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*", "@types/invariant": "2.2.37", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "fork-ts-checker-webpack-plugin": "9.0.2", diff --git a/workspaces/repository-scripts/package.json b/workspaces/repository-scripts/package.json index 8d24deea..5e8e01fb 100644 --- a/workspaces/repository-scripts/package.json +++ b/workspaces/repository-scripts/package.json @@ -31,6 +31,7 @@ "devDependencies": { "@code-chronicles/eslint-config": "workspace:*", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "prettier": "3.3.3", "type-fest": "4.26.1", diff --git a/workspaces/repository-scripts/src/typecheck.ts b/workspaces/repository-scripts/src/typecheck.ts index df45fbe3..31ba5dac 100644 --- a/workspaces/repository-scripts/src/typecheck.ts +++ b/workspaces/repository-scripts/src/typecheck.ts @@ -68,7 +68,7 @@ async function main(): Promise { return; } - await reportCommandAndSpawn("tsc", ["--pretty", "--project", "."], { + await reportCommandAndSpawn("tsgo", ["--pretty", "--project", "."], { stdio: "inherit", env, }); diff --git a/workspaces/simon-game/package.json b/workspaces/simon-game/package.json index 854c277c..26a48283 100644 --- a/workspaces/simon-game/package.json +++ b/workspaces/simon-game/package.json @@ -31,6 +31,7 @@ "@types/node": "22.9.0", "@types/react": "18.3.12", "@types/react-dom": "18.3.1", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "fork-ts-checker-webpack-plugin": "9.0.2", diff --git a/workspaces/util/package.json b/workspaces/util/package.json index 91fe5ab3..6ee30f35 100644 --- a/workspaces/util/package.json +++ b/workspaces/util/package.json @@ -36,6 +36,7 @@ "@jest/globals": "29.7.0", "@types/chrome": "patch:@types/chrome@npm%3A0.0.280#~/.yarn/patches/@types-chrome-npm-0.0.280-34ee4ba05a.patch", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "jest": "29.7.0", "prettier": "3.3.3", diff --git a/workspaces/util/src/stringToCase.ts b/workspaces/util/src/stringToCase.ts index 020277ac..31b1ef3a 100644 --- a/workspaces/util/src/stringToCase.ts +++ b/workspaces/util/src/stringToCase.ts @@ -17,6 +17,5 @@ export function stringToCase(s: string, stringCase: Case): string { // @ts-expect-error Unreachable code, switch should be exhaustive. console.error(`Unsupported case: ${stringCase}`); - // @ts-expect-error Unreachable code, switch should be exhaustive. return s; } diff --git a/workspaces/webpack-chrome-extension-manifest-plugin/package.json b/workspaces/webpack-chrome-extension-manifest-plugin/package.json index 2f41eb77..b51b8730 100644 --- a/workspaces/webpack-chrome-extension-manifest-plugin/package.json +++ b/workspaces/webpack-chrome-extension-manifest-plugin/package.json @@ -28,6 +28,7 @@ "@code-chronicles/eslint-config": "workspace:*", "@code-chronicles/repository-scripts": "workspace:*", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "prettier": "3.3.3", "tsx": "4.19.2", diff --git a/workspaces/webpack-make-output-executable-plugin/package.json b/workspaces/webpack-make-output-executable-plugin/package.json index 97f88b9e..e0c9783b 100644 --- a/workspaces/webpack-make-output-executable-plugin/package.json +++ b/workspaces/webpack-make-output-executable-plugin/package.json @@ -25,6 +25,7 @@ "@code-chronicles/eslint-config": "workspace:*", "@code-chronicles/repository-scripts": "workspace:*", "@types/node": "22.9.0", + "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "prettier": "3.3.3", "tsx": "4.19.2", diff --git a/yarn.lock b/yarn.lock index bf6a1b47..13faf312 100644 --- a/yarn.lock +++ b/yarn.lock @@ -850,6 +850,7 @@ __metadata: "@types/react": "npm:18.3.12" "@types/react-dom": "npm:18.3.1" "@types/react-syntax-highlighter": "npm:15.5.13" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" copy-webpack-plugin: "npm:12.0.2" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" @@ -891,6 +892,7 @@ __metadata: "@code-chronicles/util": "workspace:*" "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -914,6 +916,7 @@ __metadata: "@stylistic/eslint-plugin-ts": "npm:2.10.1" "@typescript-eslint/eslint-plugin": "npm:8.13.0" "@typescript-eslint/parser": "npm:8.13.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" eslint-import-resolver-typescript: "npm:3.6.3" eslint-plugin-import: "npm:2.31.0" @@ -936,6 +939,7 @@ __metadata: "@code-chronicles/util": "workspace:*" "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -958,6 +962,7 @@ __metadata: "@code-chronicles/util": "workspace:*" "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -977,6 +982,7 @@ __metadata: "@code-chronicles/eslint-config": "workspace:*" "@code-chronicles/util": "workspace:*" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" nullthrows: "patch:nullthrows@npm%3A1.1.1#~/.yarn/patches/nullthrows-npm-1.1.1-3d1f817134.patch" prettier: "npm:3.3.3" @@ -994,6 +1000,7 @@ __metadata: "@code-chronicles/util": "workspace:*" "@types/mdast": "npm:4.0.4" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" mdast: "npm:3.0.0" prettier: "npm:3.3.3" @@ -1015,6 +1022,7 @@ __metadata: "@graphql-codegen/cli": "npm:5.0.3" "@graphql-codegen/near-operation-file-preset": "npm:3.0.0" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" dedent: "npm:1.5.3" eslint: "npm:9.14.0" @@ -1042,6 +1050,7 @@ __metadata: "@code-chronicles/util": "workspace:*" "@code-chronicles/webpack-chrome-extension-manifest-plugin": "workspace:*" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -1068,6 +1077,7 @@ __metadata: "@types/node": "npm:22.9.0" "@types/react": "npm:18.3.12" "@types/react-dom": "npm:18.3.1" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -1096,6 +1106,7 @@ __metadata: "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*" "@types/invariant": "npm:2.2.37" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" bufferutil: "npm:4.0.8" cross-env: "npm:7.0.3" dedent: "npm:1.5.3" @@ -1121,6 +1132,7 @@ __metadata: "@code-chronicles/eslint-config": "workspace:*" "@code-chronicles/util": "workspace:*" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" chalk: "npm:5.3.0" eslint: "npm:9.14.0" prettier: "npm:3.3.3" @@ -1143,6 +1155,7 @@ __metadata: "@types/node": "npm:22.9.0" "@types/react": "npm:18.3.12" "@types/react-dom": "npm:18.3.1" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -1166,6 +1179,7 @@ __metadata: "@jest/globals": "npm:29.7.0" "@types/chrome": "patch:@types/chrome@npm%3A0.0.280#~/.yarn/patches/@types-chrome-npm-0.0.280-34ee4ba05a.patch" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" jest: "npm:29.7.0" prettier: "npm:3.3.3" @@ -1188,6 +1202,7 @@ __metadata: "@code-chronicles/repository-scripts": "workspace:*" "@code-chronicles/util": "workspace:*" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" prettier: "npm:3.3.3" tsx: "npm:4.19.2" @@ -1204,6 +1219,7 @@ __metadata: "@code-chronicles/eslint-config": "workspace:*" "@code-chronicles/repository-scripts": "workspace:*" "@types/node": "npm:22.9.0" + "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" prettier: "npm:3.3.3" tsx: "npm:4.19.2" @@ -3218,6 +3234,87 @@ __metadata: languageName: node linkType: hard +"@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260217.1": + version: 7.0.0-dev.20260217.1 + resolution: "@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260217.1" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260217.1": + version: 7.0.0-dev.20260217.1 + resolution: "@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260217.1" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260217.1": + version: 7.0.0-dev.20260217.1 + resolution: "@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260217.1" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260217.1": + version: 7.0.0-dev.20260217.1 + resolution: "@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260217.1" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260217.1": + version: 7.0.0-dev.20260217.1 + resolution: "@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260217.1" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260217.1": + version: 7.0.0-dev.20260217.1 + resolution: "@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260217.1" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260217.1": + version: 7.0.0-dev.20260217.1 + resolution: "@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260217.1" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@typescript/native-preview@npm:7.0.0-dev.20260217.1": + version: 7.0.0-dev.20260217.1 + resolution: "@typescript/native-preview@npm:7.0.0-dev.20260217.1" + dependencies: + "@typescript/native-preview-darwin-arm64": "npm:7.0.0-dev.20260217.1" + "@typescript/native-preview-darwin-x64": "npm:7.0.0-dev.20260217.1" + "@typescript/native-preview-linux-arm": "npm:7.0.0-dev.20260217.1" + "@typescript/native-preview-linux-arm64": "npm:7.0.0-dev.20260217.1" + "@typescript/native-preview-linux-x64": "npm:7.0.0-dev.20260217.1" + "@typescript/native-preview-win32-arm64": "npm:7.0.0-dev.20260217.1" + "@typescript/native-preview-win32-x64": "npm:7.0.0-dev.20260217.1" + dependenciesMeta: + "@typescript/native-preview-darwin-arm64": + optional: true + "@typescript/native-preview-darwin-x64": + optional: true + "@typescript/native-preview-linux-arm": + optional: true + "@typescript/native-preview-linux-arm64": + optional: true + "@typescript/native-preview-linux-x64": + optional: true + "@typescript/native-preview-win32-arm64": + optional: true + "@typescript/native-preview-win32-x64": + optional: true + bin: + tsgo: bin/tsgo.js + checksum: 10c0/894bcdef98b8eb44a9b349a854b80c12d4260582cc258c31f249ca1acb97c909705f79ff26248b76573a751ecdddb452985faf0fa1e665d4a50783a59a1a768e + languageName: node + linkType: hard + "@vladfrangu/async_event_emitter@npm:^2.2.4, @vladfrangu/async_event_emitter@npm:^2.4.6": version: 2.4.6 resolution: "@vladfrangu/async_event_emitter@npm:2.4.6" From 0ebc38ea2ba4622d0663fc9ae7a8c990b16a827d Mon Sep 17 00:00:00 2001 From: skdthread Date: Tue, 24 Feb 2026 13:29:29 +0100 Subject: [PATCH 2/5] Allow Unreachable code for tsgo --- workspaces/adventure-pack/webpack.config.ts | 9 ++++++++- .../download-leetcode-submissions/webpack.config.ts | 9 ++++++++- workspaces/fetch-leetcode-problem-list/webpack.config.ts | 9 ++++++++- .../webpack.config.ts | 9 ++++++++- workspaces/leetcode-prettier-extension/webpack.config.ts | 9 ++++++++- workspaces/leetcode-zen-mode/webpack.config.ts | 9 ++++++++- .../post-leetcode-potd-to-discord/webpack.config.ts | 9 ++++++++- workspaces/simon-game/webpack.config.ts | 9 ++++++++- 8 files changed, 64 insertions(+), 8 deletions(-) diff --git a/workspaces/adventure-pack/webpack.config.ts b/workspaces/adventure-pack/webpack.config.ts index f83bedf1..328dc771 100644 --- a/workspaces/adventure-pack/webpack.config.ts +++ b/workspaces/adventure-pack/webpack.config.ts @@ -51,7 +51,14 @@ const config: Configuration = { new WriteGoodiesJsonWebpackPlugin(), new WriteIndexHtmlWebpackPlugin(commitHash), - new ForkTsCheckerWebpackPlugin(), + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], optimization: { diff --git a/workspaces/download-leetcode-submissions/webpack.config.ts b/workspaces/download-leetcode-submissions/webpack.config.ts index 9358182e..97a02fc6 100644 --- a/workspaces/download-leetcode-submissions/webpack.config.ts +++ b/workspaces/download-leetcode-submissions/webpack.config.ts @@ -64,7 +64,14 @@ const config: Configuration = { new WebpackMakeOutputExecutablePlugin(), - new ForkTsCheckerWebpackPlugin(), + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], }; diff --git a/workspaces/fetch-leetcode-problem-list/webpack.config.ts b/workspaces/fetch-leetcode-problem-list/webpack.config.ts index 9358182e..97a02fc6 100644 --- a/workspaces/fetch-leetcode-problem-list/webpack.config.ts +++ b/workspaces/fetch-leetcode-problem-list/webpack.config.ts @@ -64,7 +64,14 @@ const config: Configuration = { new WebpackMakeOutputExecutablePlugin(), - new ForkTsCheckerWebpackPlugin(), + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], }; diff --git a/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts b/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts index 9358182e..97a02fc6 100644 --- a/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts +++ b/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts @@ -64,7 +64,14 @@ const config: Configuration = { new WebpackMakeOutputExecutablePlugin(), - new ForkTsCheckerWebpackPlugin(), + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], }; diff --git a/workspaces/leetcode-prettier-extension/webpack.config.ts b/workspaces/leetcode-prettier-extension/webpack.config.ts index c852f769..e09d0177 100644 --- a/workspaces/leetcode-prettier-extension/webpack.config.ts +++ b/workspaces/leetcode-prettier-extension/webpack.config.ts @@ -38,7 +38,14 @@ const config: Configuration = { }, plugins: [ - new ForkTsCheckerWebpackPlugin(), + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), new WebpackChromeExtensionManifestPlugin({ name: "LeetCode Prettier Formatting", diff --git a/workspaces/leetcode-zen-mode/webpack.config.ts b/workspaces/leetcode-zen-mode/webpack.config.ts index a399bf24..615971e1 100644 --- a/workspaces/leetcode-zen-mode/webpack.config.ts +++ b/workspaces/leetcode-zen-mode/webpack.config.ts @@ -70,7 +70,14 @@ const config: Configuration = { }, plugins: [ - new ForkTsCheckerWebpackPlugin(), + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), new WriteOptionsHtmlWebpackPlugin({ htmlFilename: OPTIONS_HTML_FILENAME, diff --git a/workspaces/post-leetcode-potd-to-discord/webpack.config.ts b/workspaces/post-leetcode-potd-to-discord/webpack.config.ts index 457f38f1..5a984ff2 100644 --- a/workspaces/post-leetcode-potd-to-discord/webpack.config.ts +++ b/workspaces/post-leetcode-potd-to-discord/webpack.config.ts @@ -70,7 +70,14 @@ const config: Configuration = { new WebpackMakeOutputExecutablePlugin(), - new ForkTsCheckerWebpackPlugin(), + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], }; diff --git a/workspaces/simon-game/webpack.config.ts b/workspaces/simon-game/webpack.config.ts index 21ebaecf..2f29756b 100644 --- a/workspaces/simon-game/webpack.config.ts +++ b/workspaces/simon-game/webpack.config.ts @@ -35,7 +35,14 @@ const config: Configuration = { }, plugins: [ - new ForkTsCheckerWebpackPlugin(), + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), new WriteIndexHtmlWebpackPlugin(), ], From fc89b28a76ff092f853c87a62eed51a4355843ed Mon Sep 17 00:00:00 2001 From: skdthread Date: Tue, 24 Feb 2026 13:57:32 +0100 Subject: [PATCH 3/5] fix typecheck error --- workspaces/adventure-pack/package.json | 1 - workspaces/adventure-pack/webpack.config.ts | 10 ---------- workspaces/download-leetcode-submissions/package.json | 1 - .../download-leetcode-submissions/webpack.config.ts | 10 ---------- workspaces/fetch-leetcode-problem-list/package.json | 1 - .../fetch-leetcode-problem-list/webpack.config.ts | 10 ---------- .../package.json | 1 - .../webpack.config.ts | 10 ---------- workspaces/leetcode-prettier-extension/package.json | 1 - .../leetcode-prettier-extension/webpack.config.ts | 10 ---------- workspaces/leetcode-zen-mode/package.json | 1 - workspaces/leetcode-zen-mode/webpack.config.ts | 10 ---------- workspaces/post-leetcode-potd-to-discord/package.json | 1 - .../post-leetcode-potd-to-discord/webpack.config.ts | 10 ---------- workspaces/simon-game/package.json | 1 - workspaces/simon-game/webpack.config.ts | 10 ---------- 16 files changed, 88 deletions(-) diff --git a/workspaces/adventure-pack/package.json b/workspaces/adventure-pack/package.json index ee770eab..423a2c73 100644 --- a/workspaces/adventure-pack/package.json +++ b/workspaces/adventure-pack/package.json @@ -78,7 +78,6 @@ "copy-webpack-plugin": "12.0.2", "cross-env": "7.0.3", "eslint": "9.14.0", - "fork-ts-checker-webpack-plugin": "9.0.2", "jest": "29.7.0", "prettier": "3.3.3", "prettier-plugin-java": "2.6.5", diff --git a/workspaces/adventure-pack/webpack.config.ts b/workspaces/adventure-pack/webpack.config.ts index 328dc771..f904ba0f 100644 --- a/workspaces/adventure-pack/webpack.config.ts +++ b/workspaces/adventure-pack/webpack.config.ts @@ -2,7 +2,6 @@ import { execSync } from "node:child_process"; import path from "node:path"; import CopyPlugin from "copy-webpack-plugin"; -import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { DefinePlugin, type Configuration } from "webpack"; import { WEB_APP_DIST } from "./src/scripts/build/constants.ts"; @@ -50,15 +49,6 @@ const config: Configuration = { new CopyPlugin({ patterns: [{ from: "css", to: WEB_APP_DIST }] }), new WriteGoodiesJsonWebpackPlugin(), new WriteIndexHtmlWebpackPlugin(commitHash), - - // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) - new ForkTsCheckerWebpackPlugin({ - typescript: { - configOverwrite: { - compilerOptions: { allowUnreachableCode: true }, - }, - }, - }), ], optimization: { diff --git a/workspaces/download-leetcode-submissions/package.json b/workspaces/download-leetcode-submissions/package.json index d2da7081..c6ae95af 100644 --- a/workspaces/download-leetcode-submissions/package.json +++ b/workspaces/download-leetcode-submissions/package.json @@ -35,7 +35,6 @@ "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", - "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/download-leetcode-submissions/webpack.config.ts b/workspaces/download-leetcode-submissions/webpack.config.ts index 97a02fc6..3efc6cfe 100644 --- a/workspaces/download-leetcode-submissions/webpack.config.ts +++ b/workspaces/download-leetcode-submissions/webpack.config.ts @@ -6,7 +6,6 @@ import { type Configuration, type ExternalItemFunctionData, } from "webpack"; -import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WebpackMakeOutputExecutablePlugin } from "@code-chronicles/webpack-make-output-executable-plugin"; @@ -63,15 +62,6 @@ const config: Configuration = { }), new WebpackMakeOutputExecutablePlugin(), - - // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) - new ForkTsCheckerWebpackPlugin({ - typescript: { - configOverwrite: { - compilerOptions: { allowUnreachableCode: true }, - }, - }, - }), ], }; diff --git a/workspaces/fetch-leetcode-problem-list/package.json b/workspaces/fetch-leetcode-problem-list/package.json index 1518431f..8d19b8b5 100644 --- a/workspaces/fetch-leetcode-problem-list/package.json +++ b/workspaces/fetch-leetcode-problem-list/package.json @@ -33,7 +33,6 @@ "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", - "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/fetch-leetcode-problem-list/webpack.config.ts b/workspaces/fetch-leetcode-problem-list/webpack.config.ts index 97a02fc6..3efc6cfe 100644 --- a/workspaces/fetch-leetcode-problem-list/webpack.config.ts +++ b/workspaces/fetch-leetcode-problem-list/webpack.config.ts @@ -6,7 +6,6 @@ import { type Configuration, type ExternalItemFunctionData, } from "webpack"; -import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WebpackMakeOutputExecutablePlugin } from "@code-chronicles/webpack-make-output-executable-plugin"; @@ -63,15 +62,6 @@ const config: Configuration = { }), new WebpackMakeOutputExecutablePlugin(), - - // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) - new ForkTsCheckerWebpackPlugin({ - typescript: { - configOverwrite: { - compilerOptions: { allowUnreachableCode: true }, - }, - }, - }), ], }; diff --git a/workspaces/fetch-recent-accepted-leetcode-submissions/package.json b/workspaces/fetch-recent-accepted-leetcode-submissions/package.json index 244d9edc..460cdba5 100644 --- a/workspaces/fetch-recent-accepted-leetcode-submissions/package.json +++ b/workspaces/fetch-recent-accepted-leetcode-submissions/package.json @@ -33,7 +33,6 @@ "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", - "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts b/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts index 97a02fc6..3efc6cfe 100644 --- a/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts +++ b/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts @@ -6,7 +6,6 @@ import { type Configuration, type ExternalItemFunctionData, } from "webpack"; -import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WebpackMakeOutputExecutablePlugin } from "@code-chronicles/webpack-make-output-executable-plugin"; @@ -63,15 +62,6 @@ const config: Configuration = { }), new WebpackMakeOutputExecutablePlugin(), - - // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) - new ForkTsCheckerWebpackPlugin({ - typescript: { - configOverwrite: { - compilerOptions: { allowUnreachableCode: true }, - }, - }, - }), ], }; diff --git a/workspaces/leetcode-prettier-extension/package.json b/workspaces/leetcode-prettier-extension/package.json index 6449e38f..abc3016a 100644 --- a/workspaces/leetcode-prettier-extension/package.json +++ b/workspaces/leetcode-prettier-extension/package.json @@ -34,7 +34,6 @@ "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", - "fork-ts-checker-webpack-plugin": "9.0.2", "monaco-editor": "0.52.0", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/leetcode-prettier-extension/webpack.config.ts b/workspaces/leetcode-prettier-extension/webpack.config.ts index e09d0177..d28d4f0e 100644 --- a/workspaces/leetcode-prettier-extension/webpack.config.ts +++ b/workspaces/leetcode-prettier-extension/webpack.config.ts @@ -1,6 +1,5 @@ import path from "node:path"; -import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import type { Configuration } from "webpack"; import { WebpackChromeExtensionManifestPlugin } from "@code-chronicles/webpack-chrome-extension-manifest-plugin"; @@ -38,15 +37,6 @@ const config: Configuration = { }, plugins: [ - // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) - new ForkTsCheckerWebpackPlugin({ - typescript: { - configOverwrite: { - compilerOptions: { allowUnreachableCode: true }, - }, - }, - }), - new WebpackChromeExtensionManifestPlugin({ name: "LeetCode Prettier Formatting", description: packageJson.description, diff --git a/workspaces/leetcode-zen-mode/package.json b/workspaces/leetcode-zen-mode/package.json index e9cc0778..88c5fcf0 100644 --- a/workspaces/leetcode-zen-mode/package.json +++ b/workspaces/leetcode-zen-mode/package.json @@ -43,7 +43,6 @@ "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", - "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/leetcode-zen-mode/webpack.config.ts b/workspaces/leetcode-zen-mode/webpack.config.ts index 615971e1..ecac82e6 100644 --- a/workspaces/leetcode-zen-mode/webpack.config.ts +++ b/workspaces/leetcode-zen-mode/webpack.config.ts @@ -1,6 +1,5 @@ import path from "node:path"; -import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import type { JsonValue } from "type-fest"; import type { Configuration } from "webpack"; @@ -70,15 +69,6 @@ const config: Configuration = { }, plugins: [ - // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) - new ForkTsCheckerWebpackPlugin({ - typescript: { - configOverwrite: { - compilerOptions: { allowUnreachableCode: true }, - }, - }, - }), - new WriteOptionsHtmlWebpackPlugin({ htmlFilename: OPTIONS_HTML_FILENAME, jsFilename: OPTIONS_SCRIPT_FILENAME, diff --git a/workspaces/post-leetcode-potd-to-discord/package.json b/workspaces/post-leetcode-potd-to-discord/package.json index 55794a56..da1b1305 100644 --- a/workspaces/post-leetcode-potd-to-discord/package.json +++ b/workspaces/post-leetcode-potd-to-discord/package.json @@ -41,7 +41,6 @@ "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", - "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "tsx": "4.19.2", "typescript": "5.6.3", diff --git a/workspaces/post-leetcode-potd-to-discord/webpack.config.ts b/workspaces/post-leetcode-potd-to-discord/webpack.config.ts index 5a984ff2..3872c1fd 100644 --- a/workspaces/post-leetcode-potd-to-discord/webpack.config.ts +++ b/workspaces/post-leetcode-potd-to-discord/webpack.config.ts @@ -6,7 +6,6 @@ import { type Configuration, type ExternalItemFunctionData, } from "webpack"; -import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WebpackMakeOutputExecutablePlugin } from "@code-chronicles/webpack-make-output-executable-plugin"; @@ -69,15 +68,6 @@ const config: Configuration = { }), new WebpackMakeOutputExecutablePlugin(), - - // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) - new ForkTsCheckerWebpackPlugin({ - typescript: { - configOverwrite: { - compilerOptions: { allowUnreachableCode: true }, - }, - }, - }), ], }; diff --git a/workspaces/simon-game/package.json b/workspaces/simon-game/package.json index 26a48283..9eb3194e 100644 --- a/workspaces/simon-game/package.json +++ b/workspaces/simon-game/package.json @@ -34,7 +34,6 @@ "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", - "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "tsx": "4.19.2", "typescript": "5.6.3", diff --git a/workspaces/simon-game/webpack.config.ts b/workspaces/simon-game/webpack.config.ts index 2f29756b..ec03ca23 100644 --- a/workspaces/simon-game/webpack.config.ts +++ b/workspaces/simon-game/webpack.config.ts @@ -1,7 +1,6 @@ import path from "node:path"; import type { Configuration } from "webpack"; -import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WriteIndexHtmlWebpackPlugin } from "./src/scripts/build/WriteIndexHtmlWebpackPlugin.tsx"; @@ -35,15 +34,6 @@ const config: Configuration = { }, plugins: [ - // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) - new ForkTsCheckerWebpackPlugin({ - typescript: { - configOverwrite: { - compilerOptions: { allowUnreachableCode: true }, - }, - }, - }), - new WriteIndexHtmlWebpackPlugin(), ], From 60062ad05bde411fdb6cb8f0994055942a114a11 Mon Sep 17 00:00:00 2001 From: skdthread Date: Tue, 24 Feb 2026 14:17:20 +0100 Subject: [PATCH 4/5] Revert "Add tsgo package for faster typecheck" This reverts commit b657500e26a507324c4f93dac9352e14bb3cca0e. --- workspaces/adventure-pack/package.json | 1 - .../adventure-pack/src/app/useAppState.ts | 1 + .../package.json | 1 - workspaces/eslint-config/package.json | 1 - .../fetch-leetcode-problem-list/package.json | 1 - .../package.json | 1 - .../generate-health-report/package.json | 1 - .../javascript-leetcode-month/package.json | 1 - workspaces/leetcode-api/package.json | 1 - .../leetcode-prettier-extension/package.json | 1 - workspaces/leetcode-zen-mode/package.json | 1 - .../package.json | 1 - workspaces/repository-scripts/package.json | 1 - .../repository-scripts/src/typecheck.ts | 2 +- workspaces/simon-game/package.json | 1 - workspaces/util/package.json | 1 - workspaces/util/src/stringToCase.ts | 1 + .../package.json | 1 - .../package.json | 1 - yarn.lock | 97 ------------------- 20 files changed, 3 insertions(+), 114 deletions(-) diff --git a/workspaces/adventure-pack/package.json b/workspaces/adventure-pack/package.json index 423a2c73..05692716 100644 --- a/workspaces/adventure-pack/package.json +++ b/workspaces/adventure-pack/package.json @@ -74,7 +74,6 @@ "@types/react": "18.3.12", "@types/react-dom": "18.3.1", "@types/react-syntax-highlighter": "15.5.13", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "copy-webpack-plugin": "12.0.2", "cross-env": "7.0.3", "eslint": "9.14.0", diff --git a/workspaces/adventure-pack/src/app/useAppState.ts b/workspaces/adventure-pack/src/app/useAppState.ts index 27e5267d..b96a7c31 100644 --- a/workspaces/adventure-pack/src/app/useAppState.ts +++ b/workspaces/adventure-pack/src/app/useAppState.ts @@ -70,6 +70,7 @@ function reducer(state: AppState, action: Action): AppState { // @ts-expect-error Unreachable code, switch should be exhaustive. console.error("Unhandled action type:", action); + // @ts-expect-error Unreachable code, switch should be exhaustive. return state; } diff --git a/workspaces/download-leetcode-submissions/package.json b/workspaces/download-leetcode-submissions/package.json index c6ae95af..199afe89 100644 --- a/workspaces/download-leetcode-submissions/package.json +++ b/workspaces/download-leetcode-submissions/package.json @@ -32,7 +32,6 @@ "@code-chronicles/repository-scripts": "workspace:*", "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "prettier": "3.3.3", diff --git a/workspaces/eslint-config/package.json b/workspaces/eslint-config/package.json index f8c7dce4..6ced01a3 100644 --- a/workspaces/eslint-config/package.json +++ b/workspaces/eslint-config/package.json @@ -25,7 +25,6 @@ "@stylistic/eslint-plugin-ts": "2.10.1", "@typescript-eslint/eslint-plugin": "8.13.0", "@typescript-eslint/parser": "8.13.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint-import-resolver-typescript": "3.6.3", "eslint-plugin-import": "2.31.0", "eslint-plugin-import-x": "4.4.0", diff --git a/workspaces/fetch-leetcode-problem-list/package.json b/workspaces/fetch-leetcode-problem-list/package.json index 8d19b8b5..f695c411 100644 --- a/workspaces/fetch-leetcode-problem-list/package.json +++ b/workspaces/fetch-leetcode-problem-list/package.json @@ -30,7 +30,6 @@ "@code-chronicles/repository-scripts": "workspace:*", "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "prettier": "3.3.3", diff --git a/workspaces/fetch-recent-accepted-leetcode-submissions/package.json b/workspaces/fetch-recent-accepted-leetcode-submissions/package.json index 460cdba5..db62a4c4 100644 --- a/workspaces/fetch-recent-accepted-leetcode-submissions/package.json +++ b/workspaces/fetch-recent-accepted-leetcode-submissions/package.json @@ -30,7 +30,6 @@ "@code-chronicles/repository-scripts": "workspace:*", "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "prettier": "3.3.3", diff --git a/workspaces/generate-health-report/package.json b/workspaces/generate-health-report/package.json index 7db8e998..70d7df84 100644 --- a/workspaces/generate-health-report/package.json +++ b/workspaces/generate-health-report/package.json @@ -27,7 +27,6 @@ "devDependencies": { "@code-chronicles/eslint-config": "workspace:*", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "prettier": "3.3.3", "typescript": "5.6.3" diff --git a/workspaces/javascript-leetcode-month/package.json b/workspaces/javascript-leetcode-month/package.json index 550835fc..8e41570f 100644 --- a/workspaces/javascript-leetcode-month/package.json +++ b/workspaces/javascript-leetcode-month/package.json @@ -25,7 +25,6 @@ "@code-chronicles/util": "workspace:*", "@types/mdast": "4.0.4", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "mdast": "3.0.0", "prettier": "3.3.3", diff --git a/workspaces/leetcode-api/package.json b/workspaces/leetcode-api/package.json index 6f295f9f..c32e0fc3 100644 --- a/workspaces/leetcode-api/package.json +++ b/workspaces/leetcode-api/package.json @@ -41,7 +41,6 @@ "@graphql-codegen/cli": "5.0.3", "@graphql-codegen/near-operation-file-preset": "3.0.0", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "dedent": "1.5.3", "eslint": "9.14.0", diff --git a/workspaces/leetcode-prettier-extension/package.json b/workspaces/leetcode-prettier-extension/package.json index abc3016a..81869553 100644 --- a/workspaces/leetcode-prettier-extension/package.json +++ b/workspaces/leetcode-prettier-extension/package.json @@ -31,7 +31,6 @@ "@code-chronicles/repository-scripts": "workspace:*", "@code-chronicles/webpack-chrome-extension-manifest-plugin": "workspace:*", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "monaco-editor": "0.52.0", diff --git a/workspaces/leetcode-zen-mode/package.json b/workspaces/leetcode-zen-mode/package.json index 88c5fcf0..f8e97003 100644 --- a/workspaces/leetcode-zen-mode/package.json +++ b/workspaces/leetcode-zen-mode/package.json @@ -40,7 +40,6 @@ "@types/node": "22.9.0", "@types/react": "18.3.12", "@types/react-dom": "18.3.1", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "prettier": "3.3.3", diff --git a/workspaces/post-leetcode-potd-to-discord/package.json b/workspaces/post-leetcode-potd-to-discord/package.json index da1b1305..9da631da 100644 --- a/workspaces/post-leetcode-potd-to-discord/package.json +++ b/workspaces/post-leetcode-potd-to-discord/package.json @@ -38,7 +38,6 @@ "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*", "@types/invariant": "2.2.37", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "prettier": "3.3.3", diff --git a/workspaces/repository-scripts/package.json b/workspaces/repository-scripts/package.json index 5e8e01fb..8d24deea 100644 --- a/workspaces/repository-scripts/package.json +++ b/workspaces/repository-scripts/package.json @@ -31,7 +31,6 @@ "devDependencies": { "@code-chronicles/eslint-config": "workspace:*", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "prettier": "3.3.3", "type-fest": "4.26.1", diff --git a/workspaces/repository-scripts/src/typecheck.ts b/workspaces/repository-scripts/src/typecheck.ts index 31ba5dac..df45fbe3 100644 --- a/workspaces/repository-scripts/src/typecheck.ts +++ b/workspaces/repository-scripts/src/typecheck.ts @@ -68,7 +68,7 @@ async function main(): Promise { return; } - await reportCommandAndSpawn("tsgo", ["--pretty", "--project", "."], { + await reportCommandAndSpawn("tsc", ["--pretty", "--project", "."], { stdio: "inherit", env, }); diff --git a/workspaces/simon-game/package.json b/workspaces/simon-game/package.json index 9eb3194e..a80d9de2 100644 --- a/workspaces/simon-game/package.json +++ b/workspaces/simon-game/package.json @@ -31,7 +31,6 @@ "@types/node": "22.9.0", "@types/react": "18.3.12", "@types/react-dom": "18.3.1", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "cross-env": "7.0.3", "eslint": "9.14.0", "prettier": "3.3.3", diff --git a/workspaces/util/package.json b/workspaces/util/package.json index 6ee30f35..91fe5ab3 100644 --- a/workspaces/util/package.json +++ b/workspaces/util/package.json @@ -36,7 +36,6 @@ "@jest/globals": "29.7.0", "@types/chrome": "patch:@types/chrome@npm%3A0.0.280#~/.yarn/patches/@types-chrome-npm-0.0.280-34ee4ba05a.patch", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "jest": "29.7.0", "prettier": "3.3.3", diff --git a/workspaces/util/src/stringToCase.ts b/workspaces/util/src/stringToCase.ts index 31b1ef3a..020277ac 100644 --- a/workspaces/util/src/stringToCase.ts +++ b/workspaces/util/src/stringToCase.ts @@ -17,5 +17,6 @@ export function stringToCase(s: string, stringCase: Case): string { // @ts-expect-error Unreachable code, switch should be exhaustive. console.error(`Unsupported case: ${stringCase}`); + // @ts-expect-error Unreachable code, switch should be exhaustive. return s; } diff --git a/workspaces/webpack-chrome-extension-manifest-plugin/package.json b/workspaces/webpack-chrome-extension-manifest-plugin/package.json index b51b8730..2f41eb77 100644 --- a/workspaces/webpack-chrome-extension-manifest-plugin/package.json +++ b/workspaces/webpack-chrome-extension-manifest-plugin/package.json @@ -28,7 +28,6 @@ "@code-chronicles/eslint-config": "workspace:*", "@code-chronicles/repository-scripts": "workspace:*", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "prettier": "3.3.3", "tsx": "4.19.2", diff --git a/workspaces/webpack-make-output-executable-plugin/package.json b/workspaces/webpack-make-output-executable-plugin/package.json index e0c9783b..97f88b9e 100644 --- a/workspaces/webpack-make-output-executable-plugin/package.json +++ b/workspaces/webpack-make-output-executable-plugin/package.json @@ -25,7 +25,6 @@ "@code-chronicles/eslint-config": "workspace:*", "@code-chronicles/repository-scripts": "workspace:*", "@types/node": "22.9.0", - "@typescript/native-preview": "7.0.0-dev.20260217.1", "eslint": "9.14.0", "prettier": "3.3.3", "tsx": "4.19.2", diff --git a/yarn.lock b/yarn.lock index 13faf312..bf6a1b47 100644 --- a/yarn.lock +++ b/yarn.lock @@ -850,7 +850,6 @@ __metadata: "@types/react": "npm:18.3.12" "@types/react-dom": "npm:18.3.1" "@types/react-syntax-highlighter": "npm:15.5.13" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" copy-webpack-plugin: "npm:12.0.2" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" @@ -892,7 +891,6 @@ __metadata: "@code-chronicles/util": "workspace:*" "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -916,7 +914,6 @@ __metadata: "@stylistic/eslint-plugin-ts": "npm:2.10.1" "@typescript-eslint/eslint-plugin": "npm:8.13.0" "@typescript-eslint/parser": "npm:8.13.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" eslint-import-resolver-typescript: "npm:3.6.3" eslint-plugin-import: "npm:2.31.0" @@ -939,7 +936,6 @@ __metadata: "@code-chronicles/util": "workspace:*" "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -962,7 +958,6 @@ __metadata: "@code-chronicles/util": "workspace:*" "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -982,7 +977,6 @@ __metadata: "@code-chronicles/eslint-config": "workspace:*" "@code-chronicles/util": "workspace:*" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" nullthrows: "patch:nullthrows@npm%3A1.1.1#~/.yarn/patches/nullthrows-npm-1.1.1-3d1f817134.patch" prettier: "npm:3.3.3" @@ -1000,7 +994,6 @@ __metadata: "@code-chronicles/util": "workspace:*" "@types/mdast": "npm:4.0.4" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" mdast: "npm:3.0.0" prettier: "npm:3.3.3" @@ -1022,7 +1015,6 @@ __metadata: "@graphql-codegen/cli": "npm:5.0.3" "@graphql-codegen/near-operation-file-preset": "npm:3.0.0" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" dedent: "npm:1.5.3" eslint: "npm:9.14.0" @@ -1050,7 +1042,6 @@ __metadata: "@code-chronicles/util": "workspace:*" "@code-chronicles/webpack-chrome-extension-manifest-plugin": "workspace:*" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -1077,7 +1068,6 @@ __metadata: "@types/node": "npm:22.9.0" "@types/react": "npm:18.3.12" "@types/react-dom": "npm:18.3.1" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -1106,7 +1096,6 @@ __metadata: "@code-chronicles/webpack-make-output-executable-plugin": "workspace:*" "@types/invariant": "npm:2.2.37" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" bufferutil: "npm:4.0.8" cross-env: "npm:7.0.3" dedent: "npm:1.5.3" @@ -1132,7 +1121,6 @@ __metadata: "@code-chronicles/eslint-config": "workspace:*" "@code-chronicles/util": "workspace:*" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" chalk: "npm:5.3.0" eslint: "npm:9.14.0" prettier: "npm:3.3.3" @@ -1155,7 +1143,6 @@ __metadata: "@types/node": "npm:22.9.0" "@types/react": "npm:18.3.12" "@types/react-dom": "npm:18.3.1" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" cross-env: "npm:7.0.3" eslint: "npm:9.14.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" @@ -1179,7 +1166,6 @@ __metadata: "@jest/globals": "npm:29.7.0" "@types/chrome": "patch:@types/chrome@npm%3A0.0.280#~/.yarn/patches/@types-chrome-npm-0.0.280-34ee4ba05a.patch" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" jest: "npm:29.7.0" prettier: "npm:3.3.3" @@ -1202,7 +1188,6 @@ __metadata: "@code-chronicles/repository-scripts": "workspace:*" "@code-chronicles/util": "workspace:*" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" prettier: "npm:3.3.3" tsx: "npm:4.19.2" @@ -1219,7 +1204,6 @@ __metadata: "@code-chronicles/eslint-config": "workspace:*" "@code-chronicles/repository-scripts": "workspace:*" "@types/node": "npm:22.9.0" - "@typescript/native-preview": "npm:7.0.0-dev.20260217.1" eslint: "npm:9.14.0" prettier: "npm:3.3.3" tsx: "npm:4.19.2" @@ -3234,87 +3218,6 @@ __metadata: languageName: node linkType: hard -"@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260217.1": - version: 7.0.0-dev.20260217.1 - resolution: "@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260217.1" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260217.1": - version: 7.0.0-dev.20260217.1 - resolution: "@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260217.1" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260217.1": - version: 7.0.0-dev.20260217.1 - resolution: "@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260217.1" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - -"@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260217.1": - version: 7.0.0-dev.20260217.1 - resolution: "@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260217.1" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - -"@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260217.1": - version: 7.0.0-dev.20260217.1 - resolution: "@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260217.1" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - -"@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260217.1": - version: 7.0.0-dev.20260217.1 - resolution: "@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260217.1" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260217.1": - version: 7.0.0-dev.20260217.1 - resolution: "@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260217.1" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - -"@typescript/native-preview@npm:7.0.0-dev.20260217.1": - version: 7.0.0-dev.20260217.1 - resolution: "@typescript/native-preview@npm:7.0.0-dev.20260217.1" - dependencies: - "@typescript/native-preview-darwin-arm64": "npm:7.0.0-dev.20260217.1" - "@typescript/native-preview-darwin-x64": "npm:7.0.0-dev.20260217.1" - "@typescript/native-preview-linux-arm": "npm:7.0.0-dev.20260217.1" - "@typescript/native-preview-linux-arm64": "npm:7.0.0-dev.20260217.1" - "@typescript/native-preview-linux-x64": "npm:7.0.0-dev.20260217.1" - "@typescript/native-preview-win32-arm64": "npm:7.0.0-dev.20260217.1" - "@typescript/native-preview-win32-x64": "npm:7.0.0-dev.20260217.1" - dependenciesMeta: - "@typescript/native-preview-darwin-arm64": - optional: true - "@typescript/native-preview-darwin-x64": - optional: true - "@typescript/native-preview-linux-arm": - optional: true - "@typescript/native-preview-linux-arm64": - optional: true - "@typescript/native-preview-linux-x64": - optional: true - "@typescript/native-preview-win32-arm64": - optional: true - "@typescript/native-preview-win32-x64": - optional: true - bin: - tsgo: bin/tsgo.js - checksum: 10c0/894bcdef98b8eb44a9b349a854b80c12d4260582cc258c31f249ca1acb97c909705f79ff26248b76573a751ecdddb452985faf0fa1e665d4a50783a59a1a768e - languageName: node - linkType: hard - "@vladfrangu/async_event_emitter@npm:^2.2.4, @vladfrangu/async_event_emitter@npm:^2.4.6": version: 2.4.6 resolution: "@vladfrangu/async_event_emitter@npm:2.4.6" From 0b16260dfa412f225309da2b071f0f1e20cce6d6 Mon Sep 17 00:00:00 2001 From: skdthread Date: Tue, 24 Feb 2026 14:29:17 +0100 Subject: [PATCH 5/5] Revert "fix typecheck error" This reverts commit fc89b28a76ff092f853c87a62eed51a4355843ed. --- workspaces/adventure-pack/package.json | 1 + workspaces/adventure-pack/webpack.config.ts | 10 ++++++++++ workspaces/download-leetcode-submissions/package.json | 1 + .../download-leetcode-submissions/webpack.config.ts | 10 ++++++++++ workspaces/fetch-leetcode-problem-list/package.json | 1 + .../fetch-leetcode-problem-list/webpack.config.ts | 10 ++++++++++ .../package.json | 1 + .../webpack.config.ts | 10 ++++++++++ workspaces/leetcode-prettier-extension/package.json | 1 + .../leetcode-prettier-extension/webpack.config.ts | 10 ++++++++++ workspaces/leetcode-zen-mode/package.json | 1 + workspaces/leetcode-zen-mode/webpack.config.ts | 10 ++++++++++ workspaces/post-leetcode-potd-to-discord/package.json | 1 + .../post-leetcode-potd-to-discord/webpack.config.ts | 10 ++++++++++ workspaces/simon-game/package.json | 1 + workspaces/simon-game/webpack.config.ts | 10 ++++++++++ 16 files changed, 88 insertions(+) diff --git a/workspaces/adventure-pack/package.json b/workspaces/adventure-pack/package.json index 05692716..863bd8d6 100644 --- a/workspaces/adventure-pack/package.json +++ b/workspaces/adventure-pack/package.json @@ -77,6 +77,7 @@ "copy-webpack-plugin": "12.0.2", "cross-env": "7.0.3", "eslint": "9.14.0", + "fork-ts-checker-webpack-plugin": "9.0.2", "jest": "29.7.0", "prettier": "3.3.3", "prettier-plugin-java": "2.6.5", diff --git a/workspaces/adventure-pack/webpack.config.ts b/workspaces/adventure-pack/webpack.config.ts index f904ba0f..328dc771 100644 --- a/workspaces/adventure-pack/webpack.config.ts +++ b/workspaces/adventure-pack/webpack.config.ts @@ -2,6 +2,7 @@ import { execSync } from "node:child_process"; import path from "node:path"; import CopyPlugin from "copy-webpack-plugin"; +import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { DefinePlugin, type Configuration } from "webpack"; import { WEB_APP_DIST } from "./src/scripts/build/constants.ts"; @@ -49,6 +50,15 @@ const config: Configuration = { new CopyPlugin({ patterns: [{ from: "css", to: WEB_APP_DIST }] }), new WriteGoodiesJsonWebpackPlugin(), new WriteIndexHtmlWebpackPlugin(commitHash), + + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], optimization: { diff --git a/workspaces/download-leetcode-submissions/package.json b/workspaces/download-leetcode-submissions/package.json index 199afe89..6654fe92 100644 --- a/workspaces/download-leetcode-submissions/package.json +++ b/workspaces/download-leetcode-submissions/package.json @@ -34,6 +34,7 @@ "@types/node": "22.9.0", "cross-env": "7.0.3", "eslint": "9.14.0", + "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/download-leetcode-submissions/webpack.config.ts b/workspaces/download-leetcode-submissions/webpack.config.ts index 3efc6cfe..97a02fc6 100644 --- a/workspaces/download-leetcode-submissions/webpack.config.ts +++ b/workspaces/download-leetcode-submissions/webpack.config.ts @@ -6,6 +6,7 @@ import { type Configuration, type ExternalItemFunctionData, } from "webpack"; +import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WebpackMakeOutputExecutablePlugin } from "@code-chronicles/webpack-make-output-executable-plugin"; @@ -62,6 +63,15 @@ const config: Configuration = { }), new WebpackMakeOutputExecutablePlugin(), + + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], }; diff --git a/workspaces/fetch-leetcode-problem-list/package.json b/workspaces/fetch-leetcode-problem-list/package.json index f695c411..4c6f691a 100644 --- a/workspaces/fetch-leetcode-problem-list/package.json +++ b/workspaces/fetch-leetcode-problem-list/package.json @@ -32,6 +32,7 @@ "@types/node": "22.9.0", "cross-env": "7.0.3", "eslint": "9.14.0", + "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/fetch-leetcode-problem-list/webpack.config.ts b/workspaces/fetch-leetcode-problem-list/webpack.config.ts index 3efc6cfe..97a02fc6 100644 --- a/workspaces/fetch-leetcode-problem-list/webpack.config.ts +++ b/workspaces/fetch-leetcode-problem-list/webpack.config.ts @@ -6,6 +6,7 @@ import { type Configuration, type ExternalItemFunctionData, } from "webpack"; +import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WebpackMakeOutputExecutablePlugin } from "@code-chronicles/webpack-make-output-executable-plugin"; @@ -62,6 +63,15 @@ const config: Configuration = { }), new WebpackMakeOutputExecutablePlugin(), + + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], }; diff --git a/workspaces/fetch-recent-accepted-leetcode-submissions/package.json b/workspaces/fetch-recent-accepted-leetcode-submissions/package.json index db62a4c4..a5f9639e 100644 --- a/workspaces/fetch-recent-accepted-leetcode-submissions/package.json +++ b/workspaces/fetch-recent-accepted-leetcode-submissions/package.json @@ -32,6 +32,7 @@ "@types/node": "22.9.0", "cross-env": "7.0.3", "eslint": "9.14.0", + "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts b/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts index 3efc6cfe..97a02fc6 100644 --- a/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts +++ b/workspaces/fetch-recent-accepted-leetcode-submissions/webpack.config.ts @@ -6,6 +6,7 @@ import { type Configuration, type ExternalItemFunctionData, } from "webpack"; +import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WebpackMakeOutputExecutablePlugin } from "@code-chronicles/webpack-make-output-executable-plugin"; @@ -62,6 +63,15 @@ const config: Configuration = { }), new WebpackMakeOutputExecutablePlugin(), + + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], }; diff --git a/workspaces/leetcode-prettier-extension/package.json b/workspaces/leetcode-prettier-extension/package.json index 81869553..bca692ff 100644 --- a/workspaces/leetcode-prettier-extension/package.json +++ b/workspaces/leetcode-prettier-extension/package.json @@ -33,6 +33,7 @@ "@types/node": "22.9.0", "cross-env": "7.0.3", "eslint": "9.14.0", + "fork-ts-checker-webpack-plugin": "9.0.2", "monaco-editor": "0.52.0", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/leetcode-prettier-extension/webpack.config.ts b/workspaces/leetcode-prettier-extension/webpack.config.ts index d28d4f0e..e09d0177 100644 --- a/workspaces/leetcode-prettier-extension/webpack.config.ts +++ b/workspaces/leetcode-prettier-extension/webpack.config.ts @@ -1,5 +1,6 @@ import path from "node:path"; +import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import type { Configuration } from "webpack"; import { WebpackChromeExtensionManifestPlugin } from "@code-chronicles/webpack-chrome-extension-manifest-plugin"; @@ -37,6 +38,15 @@ const config: Configuration = { }, plugins: [ + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), + new WebpackChromeExtensionManifestPlugin({ name: "LeetCode Prettier Formatting", description: packageJson.description, diff --git a/workspaces/leetcode-zen-mode/package.json b/workspaces/leetcode-zen-mode/package.json index f8e97003..ac950b55 100644 --- a/workspaces/leetcode-zen-mode/package.json +++ b/workspaces/leetcode-zen-mode/package.json @@ -42,6 +42,7 @@ "@types/react-dom": "18.3.1", "cross-env": "7.0.3", "eslint": "9.14.0", + "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "ts-loader": "9.5.1", "tsx": "4.19.2", diff --git a/workspaces/leetcode-zen-mode/webpack.config.ts b/workspaces/leetcode-zen-mode/webpack.config.ts index ecac82e6..615971e1 100644 --- a/workspaces/leetcode-zen-mode/webpack.config.ts +++ b/workspaces/leetcode-zen-mode/webpack.config.ts @@ -1,5 +1,6 @@ import path from "node:path"; +import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import type { JsonValue } from "type-fest"; import type { Configuration } from "webpack"; @@ -69,6 +70,15 @@ const config: Configuration = { }, plugins: [ + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), + new WriteOptionsHtmlWebpackPlugin({ htmlFilename: OPTIONS_HTML_FILENAME, jsFilename: OPTIONS_SCRIPT_FILENAME, diff --git a/workspaces/post-leetcode-potd-to-discord/package.json b/workspaces/post-leetcode-potd-to-discord/package.json index 9da631da..a82527d8 100644 --- a/workspaces/post-leetcode-potd-to-discord/package.json +++ b/workspaces/post-leetcode-potd-to-discord/package.json @@ -40,6 +40,7 @@ "@types/node": "22.9.0", "cross-env": "7.0.3", "eslint": "9.14.0", + "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "tsx": "4.19.2", "typescript": "5.6.3", diff --git a/workspaces/post-leetcode-potd-to-discord/webpack.config.ts b/workspaces/post-leetcode-potd-to-discord/webpack.config.ts index 3872c1fd..5a984ff2 100644 --- a/workspaces/post-leetcode-potd-to-discord/webpack.config.ts +++ b/workspaces/post-leetcode-potd-to-discord/webpack.config.ts @@ -6,6 +6,7 @@ import { type Configuration, type ExternalItemFunctionData, } from "webpack"; +import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WebpackMakeOutputExecutablePlugin } from "@code-chronicles/webpack-make-output-executable-plugin"; @@ -68,6 +69,15 @@ const config: Configuration = { }), new WebpackMakeOutputExecutablePlugin(), + + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), ], }; diff --git a/workspaces/simon-game/package.json b/workspaces/simon-game/package.json index a80d9de2..854c277c 100644 --- a/workspaces/simon-game/package.json +++ b/workspaces/simon-game/package.json @@ -33,6 +33,7 @@ "@types/react-dom": "18.3.1", "cross-env": "7.0.3", "eslint": "9.14.0", + "fork-ts-checker-webpack-plugin": "9.0.2", "prettier": "3.3.3", "tsx": "4.19.2", "typescript": "5.6.3", diff --git a/workspaces/simon-game/webpack.config.ts b/workspaces/simon-game/webpack.config.ts index ec03ca23..2f29756b 100644 --- a/workspaces/simon-game/webpack.config.ts +++ b/workspaces/simon-game/webpack.config.ts @@ -1,6 +1,7 @@ import path from "node:path"; import type { Configuration } from "webpack"; +import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import { WriteIndexHtmlWebpackPlugin } from "./src/scripts/build/WriteIndexHtmlWebpackPlugin.tsx"; @@ -34,6 +35,15 @@ const config: Configuration = { }, plugins: [ + // allowUnreachableCode necessary for tsgo (exhaustive switch handling differs from tsc) + new ForkTsCheckerWebpackPlugin({ + typescript: { + configOverwrite: { + compilerOptions: { allowUnreachableCode: true }, + }, + }, + }), + new WriteIndexHtmlWebpackPlugin(), ],