From 25802351afdf69bb785f900404fc57db77f5d196 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Tue, 25 Oct 2022 20:48:06 -0600 Subject: [PATCH] Refactor tsconfigs to share compiler options This lets each config specify *only* how it actually does a build (or not!), while sharing the config explicitly. --- tsconfig.compiler-options.json | 34 ++++++++++++++++++++++++++++++++++ tsconfig.json | 33 +-------------------------------- tsconfig.types.json | 10 ++-------- 3 files changed, 37 insertions(+), 40 deletions(-) create mode 100644 tsconfig.compiler-options.json diff --git a/tsconfig.compiler-options.json b/tsconfig.compiler-options.json new file mode 100644 index 00000000000..5a198d5463c --- /dev/null +++ b/tsconfig.compiler-options.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + // Compilation Configuration + "target": "es2019", + "sourceMap": true, + "baseUrl": "packages", + "rootDir": "packages", + + // Environment Configuration + "experimentalDecorators": true, + "moduleResolution": "node", + + // Enhance Strictness + "strict": true, + "noImplicitReturns": true, + "allowUnreachableCode": false, + "noPropertyAccessFromIndexSignature": true, + "noUnusedLocals": true, + "noUncheckedIndexedAccess": true, + "noUnusedParameters": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": false, + + "newLine": "LF", + + "allowJs": true, + "checkJs": false, + "paths": { + "backburner": [ + "../node_modules/backburner.js/dist/backburner.d.ts" + ] + } + } +} diff --git a/tsconfig.json b/tsconfig.json index be916d24386..e1d5aa8b6c6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,39 +1,8 @@ { + "extends": "./tsconfig.compiler-options.json", "compilerOptions": { - // Compilation Configuration - "target": "es2019", - "sourceMap": true, - "outDir": "dist", - "baseUrl": "packages", - "rootDir": "packages", - - // Environment Configuration - "experimentalDecorators": true, - "moduleResolution": "node", - - // Enhance Strictness - "strict": true, - "noImplicitReturns": true, - "allowUnreachableCode": false, - "noPropertyAccessFromIndexSignature": true, - "noUnusedLocals": true, - "noUncheckedIndexedAccess": true, - "noUnusedParameters": true, - "esModuleInterop": false, - "allowSyntheticDefaultImports": false, - - "newLine": "LF", "noEmit": true, - - "allowJs": true, - "checkJs": false, - - "paths": { - "backburner": ["../node_modules/backburner.js/dist/backburner.d.ts"] - } }, - "include": ["packages/**/*.ts"], - "exclude": ["dist", "node_modules", "tmp", "types"] } diff --git a/tsconfig.types.json b/tsconfig.types.json index d38a1192a2f..bc46058f20d 100644 --- a/tsconfig.types.json +++ b/tsconfig.types.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": "./tsconfig.json", + "extends": "./tsconfig.compiler-options.json", "compilerOptions": { "noEmit": false, "declaration": true, @@ -17,12 +17,6 @@ "packages/@glimmer/**/*" ], "exclude": [ - "dist", - "node_modules", - "tmp", - "types", - "packages/ember-template-compiler", - "packages/ember-testing", - "packages/internal-test-helpers" + "**/type-tests" ] }