From e0f79fe4b7e5d42bb58f3cbdeec4386180d73b8e Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Thu, 17 Sep 2020 17:48:36 -0400 Subject: [PATCH] feat: add skipLibCheck and forceConsistentCasingInFileNames - as defaults to the templates' tsconfigs - these are now recommended by TS to be set to true, which can be seen in the TSConfig Reference and @tsconfig/recommended - c.f. https://www.typescriptlang.org/tsconfig and https://www.npmjs.com/package/@tsconfig/recommended - also add to all fixtures - yea some centralization/extends or dogfooding create would help reduce all this duplication - skipLibCheck is a big perf gain, though it seems to only affect `tsc --noEmit` usage and rollup-plugin-typescript2 seems to ignore it - I have an existing issue open on the matter - forceConsistentCasingInFileNames is a no-brainer to help avoid a bug that is easy to make and hard to debug - also add a trailing comma for ease of use and better diffing - not to fixtures though, because there is a test for this --- templates/basic/tsconfig.json | 4 +++- templates/react-with-storybook/tsconfig.json | 4 +++- templates/react/tsconfig.json | 4 +++- test/e2e/fixtures/build-default/tsconfig.json | 4 +++- test/e2e/fixtures/build-invalid/tsconfig.json | 4 +++- test/e2e/fixtures/build-withTsconfig/tsconfig.base.json | 4 +++- test/integration/fixtures/build-options/tsconfig.json | 4 +++- test/integration/fixtures/build-withBabel/tsconfig.json | 4 +++- test/integration/fixtures/build-withConfig/tsconfig.json | 4 +++- 9 files changed, 27 insertions(+), 9 deletions(-) diff --git a/templates/basic/tsconfig.json b/templates/basic/tsconfig.json index 816d09263..e6945ffce 100644 --- a/templates/basic/tsconfig.json +++ b/templates/basic/tsconfig.json @@ -14,6 +14,8 @@ "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "jsx": "react", - "esModuleInterop": true + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, } } diff --git a/templates/react-with-storybook/tsconfig.json b/templates/react-with-storybook/tsconfig.json index 816d09263..e6945ffce 100644 --- a/templates/react-with-storybook/tsconfig.json +++ b/templates/react-with-storybook/tsconfig.json @@ -14,6 +14,8 @@ "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "jsx": "react", - "esModuleInterop": true + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, } } diff --git a/templates/react/tsconfig.json b/templates/react/tsconfig.json index 816d09263..e6945ffce 100644 --- a/templates/react/tsconfig.json +++ b/templates/react/tsconfig.json @@ -14,6 +14,8 @@ "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "jsx": "react", - "esModuleInterop": true + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, } } diff --git a/test/e2e/fixtures/build-default/tsconfig.json b/test/e2e/fixtures/build-default/tsconfig.json index b25c2e554..ecd51ff3f 100644 --- a/test/e2e/fixtures/build-default/tsconfig.json +++ b/test/e2e/fixtures/build-default/tsconfig.json @@ -12,7 +12,9 @@ "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "jsx": "react", - "esModuleInterop": true + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true }, "include": ["src", "types"] } diff --git a/test/e2e/fixtures/build-invalid/tsconfig.json b/test/e2e/fixtures/build-invalid/tsconfig.json index b25c2e554..ecd51ff3f 100644 --- a/test/e2e/fixtures/build-invalid/tsconfig.json +++ b/test/e2e/fixtures/build-invalid/tsconfig.json @@ -12,7 +12,9 @@ "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "jsx": "react", - "esModuleInterop": true + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true }, "include": ["src", "types"] } diff --git a/test/e2e/fixtures/build-withTsconfig/tsconfig.base.json b/test/e2e/fixtures/build-withTsconfig/tsconfig.base.json index c5a66c1ea..81769b3fe 100644 --- a/test/e2e/fixtures/build-withTsconfig/tsconfig.base.json +++ b/test/e2e/fixtures/build-withTsconfig/tsconfig.base.json @@ -14,7 +14,9 @@ "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "jsx": "react", - "esModuleInterop": false + "esModuleInterop": false, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true }, "include": ["src", "types"], // test parsing of trailing comma & comment } diff --git a/test/integration/fixtures/build-options/tsconfig.json b/test/integration/fixtures/build-options/tsconfig.json index 3645ceed5..804f4bd3e 100644 --- a/test/integration/fixtures/build-options/tsconfig.json +++ b/test/integration/fixtures/build-options/tsconfig.json @@ -12,7 +12,9 @@ "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "jsx": "react", - "esModuleInterop": true + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true }, "include": ["src", "types"], } diff --git a/test/integration/fixtures/build-withBabel/tsconfig.json b/test/integration/fixtures/build-withBabel/tsconfig.json index 3645ceed5..804f4bd3e 100644 --- a/test/integration/fixtures/build-withBabel/tsconfig.json +++ b/test/integration/fixtures/build-withBabel/tsconfig.json @@ -12,7 +12,9 @@ "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "jsx": "react", - "esModuleInterop": true + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true }, "include": ["src", "types"], } diff --git a/test/integration/fixtures/build-withConfig/tsconfig.json b/test/integration/fixtures/build-withConfig/tsconfig.json index 3645ceed5..804f4bd3e 100644 --- a/test/integration/fixtures/build-withConfig/tsconfig.json +++ b/test/integration/fixtures/build-withConfig/tsconfig.json @@ -12,7 +12,9 @@ "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "jsx": "react", - "esModuleInterop": true + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true }, "include": ["src", "types"], }