From aa5f586e3b4748d425010e7f1208f1ad438327f4 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Wed, 31 Jan 2024 08:27:54 +0800 Subject: [PATCH] Centralize tsconfig To avoid duplicates and make it easier to see if we are synced with Angular default values --- apps/ng2-charts-demo/tsconfig.json | 23 ++------------------ apps/ng2-charts-demo/tsconfig.spec.json | 1 - libs/ng2-charts-schematics/tsconfig.json | 10 +-------- libs/ng2-charts-schematics/tsconfig.lib.json | 2 -- libs/ng2-charts/tsconfig.json | 20 +---------------- libs/ng2-charts/tsconfig.lib.json | 1 - libs/ng2-charts/tsconfig.spec.json | 1 - tsconfig.base.json | 22 +++++++++++++++---- 8 files changed, 22 insertions(+), 58 deletions(-) diff --git a/apps/ng2-charts-demo/tsconfig.json b/apps/ng2-charts-demo/tsconfig.json index c37972f5..f93da6ca 100644 --- a/apps/ng2-charts-demo/tsconfig.json +++ b/apps/ng2-charts-demo/tsconfig.json @@ -1,17 +1,5 @@ { - "compilerOptions": { - "target": "ES2022", - "useDefineForClassFields": false, - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "esModuleInterop": true, - }, - "files": [], - "include": [], + "extends": "../../tsconfig.base.json", "references": [ { "path": "./tsconfig.app.json" @@ -22,12 +10,5 @@ { "path": "./tsconfig.editor.json" } - ], - "extends": "../../tsconfig.base.json", - "angularCompilerOptions": { - "enableI18nLegacyMessageIdFormat": false, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true - } + ] } diff --git a/apps/ng2-charts-demo/tsconfig.spec.json b/apps/ng2-charts-demo/tsconfig.spec.json index 353b8887..f6a7d97b 100644 --- a/apps/ng2-charts-demo/tsconfig.spec.json +++ b/apps/ng2-charts-demo/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "outDir": "../../dist/out-tsc", "module": "commonjs", - "target": "ES2022", "types": ["jest", "node"] }, "files": ["src/test-setup.ts"], diff --git a/libs/ng2-charts-schematics/tsconfig.json b/libs/ng2-charts-schematics/tsconfig.json index f5b85657..751b70aa 100644 --- a/libs/ng2-charts-schematics/tsconfig.json +++ b/libs/ng2-charts-schematics/tsconfig.json @@ -1,16 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "commonjs", - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true + "module": "commonjs" }, - "files": [], - "include": [], "references": [ { "path": "./tsconfig.lib.json" diff --git a/libs/ng2-charts-schematics/tsconfig.lib.json b/libs/ng2-charts-schematics/tsconfig.lib.json index 12a5bcd4..33eca2c2 100644 --- a/libs/ng2-charts-schematics/tsconfig.lib.json +++ b/libs/ng2-charts-schematics/tsconfig.lib.json @@ -1,8 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs", - "target": "ES2022", "outDir": "../../dist/out-tsc", "declaration": true, "types": ["node"] diff --git a/libs/ng2-charts/tsconfig.json b/libs/ng2-charts/tsconfig.json index 9325ad71..3c68cf4d 100644 --- a/libs/ng2-charts/tsconfig.json +++ b/libs/ng2-charts/tsconfig.json @@ -1,16 +1,5 @@ { - "compilerOptions": { - "target": "ES2022", - "useDefineForClassFields": false, - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true - }, - "files": [], - "include": [], + "extends": "../../tsconfig.base.json", "references": [ { "path": "./tsconfig.lib.json" @@ -19,11 +8,4 @@ "path": "./tsconfig.spec.json" } ], - "extends": "../../tsconfig.base.json", - "angularCompilerOptions": { - "enableI18nLegacyMessageIdFormat": false, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true - } } diff --git a/libs/ng2-charts/tsconfig.lib.json b/libs/ng2-charts/tsconfig.lib.json index 063e5257..9d46f6c0 100644 --- a/libs/ng2-charts/tsconfig.lib.json +++ b/libs/ng2-charts/tsconfig.lib.json @@ -5,7 +5,6 @@ "declaration": true, "declarationMap": true, "inlineSources": true, - "types": [] }, "exclude": [ "src/**/*.spec.ts", diff --git a/libs/ng2-charts/tsconfig.spec.json b/libs/ng2-charts/tsconfig.spec.json index 353b8887..f6a7d97b 100644 --- a/libs/ng2-charts/tsconfig.spec.json +++ b/libs/ng2-charts/tsconfig.spec.json @@ -3,7 +3,6 @@ "compilerOptions": { "outDir": "../../dist/out-tsc", "module": "commonjs", - "target": "ES2022", "types": ["jest", "node"] }, "files": ["src/test-setup.ts"], diff --git a/tsconfig.base.json b/tsconfig.base.json index 03d7db5b..992be71a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -2,19 +2,27 @@ "compileOnSave": false, "compilerOptions": { "rootDir": ".", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "skipLibCheck": true, + "esModuleInterop": true, "sourceMap": true, "declaration": false, - "moduleResolution": "node", - "emitDecoratorMetadata": true, "experimentalDecorators": true, + "moduleResolution": "node", "importHelpers": true, "target": "ES2022", "module": "ES2022", + "useDefineForClassFields": false, + "emitDecoratorMetadata": true, "lib": [ "ES2022", "dom" ], - "skipLibCheck": true, "skipDefaultLibCheck": true, "baseUrl": ".", "paths": { @@ -29,5 +37,11 @@ "exclude": [ "node_modules", "tmp" - ] + ], + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } }