From 0067b2d53358afa93ff93dff5acc00bdd33a49b7 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Sun, 7 Jun 2026 18:23:21 +0100 Subject: [PATCH] Fix frontend tsconfig for TypeScript 6.0 TypeScript 6.0 requires an explicit `rootDir` when linked-plugin symlinks push the common source directory outside the project (TS5011), and type declarations even for side-effect imports such as `moment/locale/*` (TS2882). Angular 22 also rejects `extendedDiagnostics` while `strictTemplates` is off (NG4003). --- frontend/src/typings/moment-locales.d.ts | 3 +++ frontend/tsconfig.app.json | 7 +------ frontend/tsconfig.spec.json | 6 ------ 3 files changed, 4 insertions(+), 12 deletions(-) create mode 100644 frontend/src/typings/moment-locales.d.ts diff --git a/frontend/src/typings/moment-locales.d.ts b/frontend/src/typings/moment-locales.d.ts new file mode 100644 index 00000000000..9b04389a222 --- /dev/null +++ b/frontend/src/typings/moment-locales.d.ts @@ -0,0 +1,3 @@ +// moment ships its locale files without type declarations. +// TypeScript 6.0 requires declarations even for side-effect imports (TS2882). +declare module 'moment/locale/*'; diff --git a/frontend/tsconfig.app.json b/frontend/tsconfig.app.json index 9e2448f92ac..ceec1001548 100644 --- a/frontend/tsconfig.app.json +++ b/frontend/tsconfig.app.json @@ -2,6 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", + "rootDir": "..", "jsx": "react-jsx", "types": [] }, @@ -21,12 +22,6 @@ "src/stimulus/controllers/**/*.spec.ts" ], "angularCompilerOptions": { - "extendedDiagnostics": { - "checks": { - "nullishCoalescingNotNullable": "suppress", - "optionalChainNotNullable": "suppress" - } - }, "strictTemplates": false }, "types": [ diff --git a/frontend/tsconfig.spec.json b/frontend/tsconfig.spec.json index 07113fefd61..5d27a730bcb 100644 --- a/frontend/tsconfig.spec.json +++ b/frontend/tsconfig.spec.json @@ -20,12 +20,6 @@ "src/app/**/*.module.ts" ], "angularCompilerOptions": { - "extendedDiagnostics": { - "checks": { - "nullishCoalescingNotNullable": "suppress", - "optionalChainNotNullable": "suppress" - } - }, "strictTemplates": false } }