From ca62afe03982c30dc70d7281bb0c38fa996e9ae2 Mon Sep 17 00:00:00 2001 From: Gauvino Date: Thu, 11 Jun 2026 14:53:18 +0200 Subject: [PATCH] fix(typecheck): adapt tsconfig and typecheck script to TypeScript 6 TS 6.0 changes the default of compilerOptions.types from "all packages under node_modules/@types" to []. Globals from @types/node (Buffer, NodeJS.*, process typed as never-returning on exit) and @types/jest (it, expect) were no longer resolved, producing 20 typecheck errors. Declare the two packages explicitly and add @types/node as a direct devDependency (it was previously only hoisted transitively). TS 6.0 also enables pretty diagnostics even when piped, which broke the line-based error parser in scripts/typecheck.js; force --pretty false. --- scripts/typecheck.js | 11 ++++++++++- tsconfig.json | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/typecheck.js b/scripts/typecheck.js index ea1f4bead..81a2c9bc2 100644 --- a/scripts/typecheck.js +++ b/scripts/typecheck.js @@ -140,7 +140,16 @@ function runTypeCheck() { const extraArgs = process.argv.slice(2); // Prefer local TypeScript binary when available - const runnerArgs = ["-p", "tsconfig.json", "--noEmit", ...extraArgs]; + // --pretty false: TS 6 enables pretty output even when piped, which breaks + // the line-based error parser below + const runnerArgs = [ + "-p", + "tsconfig.json", + "--noEmit", + "--pretty", + "false", + ...extraArgs, + ]; let execArgs = null; try { const tscBin = require.resolve("typescript/bin/tsc"); diff --git a/tsconfig.json b/tsconfig.json index 69354e8d0..ecd844cd7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,8 @@ "paths": { "@/*": ["./*"] }, + // TS 6.0: "types" now defaults to [] (no auto-inclusion of node_modules/@types) + "types": ["node", "jest"], "incremental": true, "tsBuildInfoFile": ".tsbuildinfo", "skipLibCheck": true,