From 2d63aaf19c9f02dd44f8ff9a318290e8e7615d35 Mon Sep 17 00:00:00 2001 From: dw-0 Date: Sat, 5 Oct 2024 19:18:59 +0200 Subject: [PATCH] feat: set up stricter style and type checks in tsconfig Signed-off-by: Dominik Willner --- apps/client/tsconfig.json | 3 ++- libs/ui/tsconfig.json | 7 +++---- tsconfig.base.json | 16 +++++++++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/apps/client/tsconfig.json b/apps/client/tsconfig.json index fa5cdf2a3..88357aa9b 100644 --- a/apps/client/tsconfig.json +++ b/apps/client/tsconfig.json @@ -15,7 +15,8 @@ ], "angularCompilerOptions": { "strictInjectionParameters": true, - "strictTemplates": false + "strictInputAccessModifiers": false, // todo: enable strict input access modifiers + "strictTemplates": false // todo: enable strict templates }, "compilerOptions": { "target": "es2020" diff --git a/libs/ui/tsconfig.json b/libs/ui/tsconfig.json index 693f120c7..6be2dcc3e 100644 --- a/libs/ui/tsconfig.json +++ b/libs/ui/tsconfig.json @@ -14,10 +14,9 @@ } ], "compilerOptions": { - "forceConsistentCasingInFileNames": true, - "strict": false, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, + "strict": false, // remove once solved in tsconfig.base.json + "noImplicitReturns": true, // remove once solved in tsconfig.base.json + "noFallthroughCasesInSwitch": true, // remove once solved in tsconfig.base.json "target": "es2020" }, "angularCompilerOptions": { diff --git a/tsconfig.base.json b/tsconfig.base.json index b67024e12..521206d3d 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -20,7 +20,21 @@ "@ghostfolio/client/*": ["apps/client/src/app/*"], "@ghostfolio/common/*": ["libs/common/src/lib/*"], "@ghostfolio/ui/*": ["libs/ui/src/lib/*"] - } + }, + "noFallthroughCasesInSwitch": true, + "forceConsistentCasingInFileNames": true, + // set to true to enable stricter type checking for this project + "strict": false, + "strictNullChecks": false, + "strictPropertyInitialization": false, + "noImplicitReturns": false, + "noImplicitAny": false, + "noImplicitThis": false, + "noImplicitOverride": false, + "noPropertyAccessFromIndexSignature": false, + "noUnusedLocals": false, + "noUnusedParameters": false, + "allowUnreachableCode": true // set to false for stricter type checking }, "exclude": ["node_modules", "tmp"] }