From 1dfe5c980dea46cada2059ef97406e3049cb16a5 Mon Sep 17 00:00:00 2001 From: Alex Christoffer Rasmussen Date: Fri, 26 Sep 2025 18:41:10 +0200 Subject: [PATCH] refactor: collect common tsconfig (#1794) * refactor: collect common tsconfig settings * chore: module and target should be lower case --- .prettierignore | 3 ++- apps/client/tsconfig.json | 17 ++--------------- apps/resolver/tsconfig.json | 15 +-------------- apps/server/tsconfig.json | 11 +++++------ packages/types/tsconfig.json | 15 +-------------- packages/utils/tsconfig.json | 17 ++--------------- tsconfig.common.json | 16 ++++++++++++++++ 7 files changed, 29 insertions(+), 65 deletions(-) create mode 100644 tsconfig.common.json diff --git a/.prettierignore b/.prettierignore index a0139e551..9f0973be1 100644 --- a/.prettierignore +++ b/.prettierignore @@ -7,4 +7,5 @@ playwright-report **/*.toml **/*.yml -**/*.json \ No newline at end of file +**/*.json +!tsconfig.common.json diff --git a/apps/client/tsconfig.json b/apps/client/tsconfig.json index 5629eaa95..399f0207b 100644 --- a/apps/client/tsconfig.json +++ b/apps/client/tsconfig.json @@ -1,6 +1,7 @@ { + "extends": "../../tsconfig.common.json", "compilerOptions": { - "target": "ESNext", + "target": "esnext", "lib": [ "dom", "dom.iterable", @@ -13,21 +14,7 @@ ], "module": "esnext", "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "skipLibCheck": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "allowUnreachableCode": false, "allowUnusedLabels": false, - "noImplicitThis": true, - "strictNullChecks": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, "removeComments": true, "preserveConstEnums": true, "allowJs": true, diff --git a/apps/resolver/tsconfig.json b/apps/resolver/tsconfig.json index 3f6b39eea..a9db8ad39 100644 --- a/apps/resolver/tsconfig.json +++ b/apps/resolver/tsconfig.json @@ -1,23 +1,10 @@ { + "extends": "../../tsconfig.common.json", "compilerOptions": { "target": "esnext", "module": "preserve", "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "skipLibCheck": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "allowUnreachableCode": false, "allowUnusedLabels": false, - "noImplicitThis": true, - "strictNullChecks": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, "removeComments": true, "preserveConstEnums": true, "allowJs": true, diff --git a/apps/server/tsconfig.json b/apps/server/tsconfig.json index f331d534d..9ce3abf48 100644 --- a/apps/server/tsconfig.json +++ b/apps/server/tsconfig.json @@ -1,13 +1,12 @@ { + "extends": "../../tsconfig.common.json", "compilerOptions": { - "strict": true, - "target": "ESNext", - "module": "Node16", - "moduleResolution": "Node16", - "allowSyntheticDefaultImports": true, + "target": "esnext", + "module": "node16", + "moduleResolution": "node16", + "noImplicitReturns": false, //TODO: fix this "allowJs": true, "esModuleInterop": true, - "skipLibCheck": true, "types": ["vitest/globals"], "outDir": "dist", "experimentalDecorators": true, diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index cc8366dc7..29bd889c4 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,23 +1,10 @@ { + "extends": "../../tsconfig.common.json", "compilerOptions": { "target": "esnext", "module": "esnext", "moduleResolution": "node10", - "resolveJsonModule": false, - "isolatedModules": false, - "skipLibCheck": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "allowUnreachableCode": false, "allowUnusedLabels": false, - "noImplicitThis": true, - "strictNullChecks": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, "removeComments": true, "preserveConstEnums": true, "allowJs": true, diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 04f6f3111..32313be24 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -1,23 +1,10 @@ { + "extends": "../../tsconfig.common.json", "compilerOptions": { - "target": "ESNext", + "target": "esnext", "module": "esnext", "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "skipLibCheck": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "allowUnreachableCode": false, "allowUnusedLabels": false, - "noImplicitThis": true, - "strictNullChecks": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, "removeComments": true, "preserveConstEnums": true, "allowJs": true, diff --git a/tsconfig.common.json b/tsconfig.common.json new file mode 100644 index 000000000..53cc6e0ed --- /dev/null +++ b/tsconfig.common.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "strict": true, + "skipLibCheck": true, + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "allowUnreachableCode": false + } +}