mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-12 08:50:25 +01:00
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.
This commit is contained in:
@@ -140,7 +140,16 @@ function runTypeCheck() {
|
|||||||
const extraArgs = process.argv.slice(2);
|
const extraArgs = process.argv.slice(2);
|
||||||
|
|
||||||
// Prefer local TypeScript binary when available
|
// 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;
|
let execArgs = null;
|
||||||
try {
|
try {
|
||||||
const tscBin = require.resolve("typescript/bin/tsc");
|
const tscBin = require.resolve("typescript/bin/tsc");
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./*"]
|
"@/*": ["./*"]
|
||||||
},
|
},
|
||||||
|
// TS 6.0: "types" now defaults to [] (no auto-inclusion of node_modules/@types)
|
||||||
|
"types": ["node", "jest"],
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": ".tsbuildinfo",
|
"tsBuildInfoFile": ".tsbuildinfo",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user