From 3ae64b5eaff83c62cb061aea822f89b4dc7b4e89 Mon Sep 17 00:00:00 2001 From: Kenrick Tandrian <60643640+KenTandrian@users.noreply.github.com> Date: Mon, 17 Aug 2026 01:33:41 +0700 Subject: [PATCH] Task/modernize TypeScript compiler options (#7642) * fix(ts): remove baseUrl from config * feat(ts): upgrade base target to es2022 * fix(client): clean up typescript target configurations * fix(ui): standardize tsconfig target configuration to es2021 * fix(ts): remove redundant project-level lib configurations * fix(ui): inherit base tsconfig target compiler option --- apps/client/tsconfig.app.json | 1 - apps/client/tsconfig.json | 4 +--- apps/client/tsconfig.spec.json | 3 +-- libs/common/tsconfig.json | 1 - libs/ui/tsconfig.json | 3 +-- libs/ui/tsconfig.lib.json | 4 +--- libs/ui/tsconfig.spec.json | 3 +-- tsconfig.base.json | 13 ++++++------- 8 files changed, 11 insertions(+), 21 deletions(-) diff --git a/apps/client/tsconfig.app.json b/apps/client/tsconfig.app.json index 56a5535d4..8e4876ef3 100644 --- a/apps/client/tsconfig.app.json +++ b/apps/client/tsconfig.app.json @@ -4,7 +4,6 @@ "outDir": "../../dist/out-tsc", "types": ["node"], "typeRoots": ["../../node_modules/@types"], - "target": "ES2022", "useDefineForClassFields": false }, "files": ["src/main.ts", "src/polyfills.ts"], diff --git a/apps/client/tsconfig.json b/apps/client/tsconfig.json index ae0aaf61a..0aa925570 100644 --- a/apps/client/tsconfig.json +++ b/apps/client/tsconfig.json @@ -20,9 +20,7 @@ "strictTemplates": false }, "compilerOptions": { - "lib": ["dom", "es2022"], "module": "preserve", - "strictNullChecks": true, - "target": "es2020" + "strictNullChecks": true } } diff --git a/apps/client/tsconfig.spec.json b/apps/client/tsconfig.spec.json index 36a2e401c..8afad0f4c 100644 --- a/apps/client/tsconfig.spec.json +++ b/apps/client/tsconfig.spec.json @@ -4,8 +4,7 @@ "outDir": "../../dist/out-tsc", "module": "preserve", "isolatedModules": true, - "types": ["jest", "node"], - "target": "es2016" + "types": ["jest", "node"] }, "files": ["src/test-setup.ts"], "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts", "jest.config.ts"] diff --git a/libs/common/tsconfig.json b/libs/common/tsconfig.json index 2b4603b71..47d6668d9 100644 --- a/libs/common/tsconfig.json +++ b/libs/common/tsconfig.json @@ -12,7 +12,6 @@ ], "compilerOptions": { "module": "preserve", - "lib": ["dom", "es2022"], "strictNullChecks": true } } diff --git a/libs/ui/tsconfig.json b/libs/ui/tsconfig.json index 51348a52a..a4a489ea2 100644 --- a/libs/ui/tsconfig.json +++ b/libs/ui/tsconfig.json @@ -14,12 +14,11 @@ } ], "compilerOptions": { - "lib": ["dom", "es2022"], "module": "preserve", - "target": "es2020", // TODO: Remove once solved in tsconfig.base.json "strict": false, "strictNullChecks": true, + "useDefineForClassFields": false, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true }, diff --git a/libs/ui/tsconfig.lib.json b/libs/ui/tsconfig.lib.json index 6fbed6f1c..b361c0b09 100644 --- a/libs/ui/tsconfig.lib.json +++ b/libs/ui/tsconfig.lib.json @@ -2,12 +2,10 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../dist/out-tsc", - "target": "es2015", "declaration": true, "declarationMap": true, "inlineSources": true, - "types": [], - "lib": ["dom", "es2022"] + "types": [] }, "exclude": [ "src/test-setup.ts", diff --git a/libs/ui/tsconfig.spec.json b/libs/ui/tsconfig.spec.json index 36a2e401c..8afad0f4c 100644 --- a/libs/ui/tsconfig.spec.json +++ b/libs/ui/tsconfig.spec.json @@ -4,8 +4,7 @@ "outDir": "../../dist/out-tsc", "module": "preserve", "isolatedModules": true, - "types": ["jest", "node"], - "target": "es2016" + "types": ["jest", "node"] }, "files": ["src/test-setup.ts"], "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts", "jest.config.ts"] diff --git a/tsconfig.base.json b/tsconfig.base.json index f831040a0..a74d9910f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -9,18 +9,17 @@ "esModuleInterop": true, "experimentalDecorators": true, "importHelpers": true, - "target": "es2015", + "target": "es2022", "module": "esnext", "typeRoots": ["node_modules/@types"], - "lib": ["es2017", "dom"], + "lib": ["dom", "es2022"], "skipLibCheck": true, "skipDefaultLibCheck": true, - "baseUrl": ".", "paths": { - "@ghostfolio/api/*": ["apps/api/src/*"], - "@ghostfolio/client/*": ["apps/client/src/app/*"], - "@ghostfolio/common/*": ["libs/common/src/lib/*"], - "@ghostfolio/ui/*": ["libs/ui/src/lib/*"] + "@ghostfolio/api/*": ["./apps/api/src/*"], + "@ghostfolio/client/*": ["./apps/client/src/app/*"], + "@ghostfolio/common/*": ["./libs/common/src/lib/*"], + "@ghostfolio/ui/*": ["./libs/ui/src/lib/*"] }, "noFallthroughCasesInSwitch": true, "forceConsistentCasingInFileNames": true,