refactor: Upgrade to TypeScript 6.0.2 (#27673)

This commit is contained in:
Iván Ovejero 2026-04-01 13:03:37 +02:00 committed by GitHub
parent 5fdb18b5f9
commit df6ee78638
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 667 additions and 618 deletions

View file

@ -9,6 +9,7 @@ const tsJestOptions = {
...compilerOptions,
declaration: false,
sourceMap: true,
rootDir: '.',
},
};

View file

@ -2,7 +2,8 @@
"extends": "@n8n/typescript-config/tsconfig.common.json",
"compilerOptions": {
"rootDir": ".",
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
"types": ["node", "jest"]
},
"include": ["src/**/*.ts", "test/**/*.ts"]
}

View file

@ -2,7 +2,8 @@
"extends": "@n8n/typescript-config/tsconfig.common.json",
"compilerOptions": {
"rootDir": ".",
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
"types": ["node", "jest"]
},
"include": ["src/**/*.ts", "test/**/*.ts"]
}

View file

@ -85,7 +85,8 @@ export class WebSocketTransport implements SyncTransport {
throw new Error('Transport not connected');
}
this.ws.send(data);
// TODO: narrow SyncTransport.send to Uint8Array<ArrayBuffer> and propagate through Y.js call sites
this.ws.send(data as unknown as Uint8Array<ArrayBuffer>);
}
onReceive(handler: ReceiveHandler): Unsubscribe {

View file

@ -8,6 +8,9 @@
},
{
"path": "./tsconfig.frontend.json"
},
{
"path": "./tsconfig.scripts.json"
}
]
}

View file

@ -0,0 +1,7 @@
{
"extends": "@n8n/typescript-config/tsconfig.backend.json",
"compilerOptions": {
"noEmit": true
},
"include": ["scripts/**/*.ts"]
}

View file

@ -2,6 +2,7 @@
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"rootDir": "src",
"outDir": "dist/cjs",
"strict": true,
"skipLibCheck": true,

View file

@ -1,8 +1,10 @@
{
"compilerOptions": {
"ignoreDeprecations": "6.0",
"target": "es2020",
"module": "es2020",
"moduleResolution": "node",
"rootDir": "src",
"outDir": "dist/esm",
"strict": true,
"skipLibCheck": true,

View file

@ -1,5 +1,5 @@
{
"extends": ["@n8n/typescript-config/tsconfig.common.json"],
"extends": ["@n8n/typescript-config/tsconfig.backend.json"],
"compilerOptions": {
"rootDir": ".",
"baseUrl": "src",

View file

@ -2,6 +2,7 @@
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"rootDir": "src",
"outDir": "dist/types",
"strict": true,
"skipLibCheck": true,

View file

@ -1,5 +1,6 @@
{
"compilerOptions": {
"ignoreDeprecations": "6.0",
"target": "ES2015",
"module": "ESNext",
"moduleResolution": "node",
@ -11,7 +12,8 @@
"declaration": true,
"declarationMap": true,
"downlevelIteration": true,
"skipLibCheck": true
"skipLibCheck": true,
"types": ["node", "jest"]
},
"include": ["src/**/*"],
"exclude": ["dist", "node_modules", "**/*.test.ts"]

View file

@ -1,5 +1,6 @@
{
"compilerOptions": {
"ignoreDeprecations": "6.0",
"composite": true,
"module": "umd",
"moduleResolution": "node",

View file

@ -1,5 +1,7 @@
{
"compilerOptions": {
"ignoreDeprecations": "6.0",
"noUncheckedSideEffectImports": false,
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",

View file

@ -1,5 +1,7 @@
{
"compilerOptions": {
"ignoreDeprecations": "6.0",
"noUncheckedSideEffectImports": false,
"strict": true,
"module": "commonjs",
"moduleResolution": "node",

View file

@ -87,7 +87,9 @@ export class EventBusController {
);
break;
default:
throw new BadRequestError(`Unknown destination type: ${body.__type}`);
throw new BadRequestError(
`Unknown destination type: ${(body as { __type: string }).__type}`,
);
}
return result.serialize();

View file

@ -3,7 +3,7 @@
"compilerOptions": {
"baseUrl": ".",
"rootDirs": [".", "../composables/src"],
"outDir": "dist",
"noEmit": true,
"moduleResolution": "bundler",
"types": ["vite/client", "unplugin-icons/types/vue", "vitest/globals"],
"typeRoots": [

View file

@ -2,7 +2,7 @@
"extends": "@n8n/typescript-config/tsconfig.frontend.json",
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist",
"noEmit": true,
"useUnknownInCatchVariables": false,
"types": ["vite/client", "vitest/globals"],
"isolatedModules": true,

View file

@ -4,7 +4,7 @@
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"baseUrl": ".",
"rootDirs": [".", "../composables/src"],
"outDir": "dist",
"noEmit": true,
"moduleResolution": "bundler",
"types": [

View file

@ -108,6 +108,7 @@ class JsonDomPointerEvent extends MouseEvent implements PointerEvent {
readonly altitudeAngle: number;
readonly azimuthAngle: number;
readonly persistentDeviceId: number;
constructor(type: string, params: PointerEventInit = {}) {
super(type, params);
@ -123,6 +124,7 @@ class JsonDomPointerEvent extends MouseEvent implements PointerEvent {
this.altitudeAngle = params.altitudeAngle ?? Math.PI / 2;
this.azimuthAngle = params.azimuthAngle ?? 0;
this.isPrimary = params.isPrimary ?? true;
this.persistentDeviceId = 0;
}
getCoalescedEvents(): PointerEvent[] {
@ -219,6 +221,8 @@ export class IntersectionObserver {
rootMargin = '';
scrollMargin = '';
thresholds = [];
disconnect() {

View file

@ -14,6 +14,8 @@ export const COMPILER_OPTIONS: ts.CompilerOptions = {
skipDefaultLibCheck: true,
noEmit: true,
noImplicitAny: false,
// Suppress TS 6.0 deprecation diagnostic for moduleResolution=node10 set by @typescript/vfs
ignoreDeprecations: '6.0',
};
export const TYPESCRIPT_AUTOCOMPLETE_THRESHOLD = '15';
export const TYPESCRIPT_FILES = {

View file

@ -10,7 +10,7 @@
"../@n8n/chat/src",
"../@n8n/design-system/src"
],
"outDir": "dist",
"noEmit": true,
"types": [
"vitest/globals",
"unplugin-icons/types/vue",

View file

@ -16,7 +16,9 @@
"exclude": [
"node_modules",
"nodes/**/*.test.ts",
"nodes/**/test/**",
"credentials/**/*.test.ts",
"credentials/**/test/**",
"utils/**/*.test.ts",
"test/**",
"../core/nodes-testing"

View file

@ -7,6 +7,7 @@
"declarationMap": true,
"sourceMap": true,
"lib": ["ES2022"],
"types": ["node"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ES2022",

File diff suppressed because it is too large Load diff

View file

@ -75,7 +75,7 @@ catalog:
ts-morph: ^27.0.2
tsdown: ^0.16.5
tsx: ^4.19.3
typescript: 5.9.2
typescript: 6.0.2
uuid: 10.0.0
vite: npm:rolldown-vite@latest
vite-plugin-dts: ^4.5.4