From 50715cb720efccfdbbef5698498b6545a6d14831 Mon Sep 17 00:00:00 2001 From: Tima Gixe Date: Sun, 4 Sep 2022 18:52:55 +0300 Subject: [PATCH 1/4] update type check command on pre-commit --- lefthook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lefthook.yml b/lefthook.yml index 1e144851..ec0bf193 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -33,7 +33,7 @@ pre-commit: type check: glob: '*.{ts,tsx}' exclude: '.docusaurus/|build/' - run: yarn tsc --skipLibCheck --noEmit --jsx react --esModuleInterop {staged_files} + run: yarn typecheck run tests: glob: '*.{js,jsx,ts,tsx}' exclude: '.docusaurus/|build/' From 3a033613502aa4dd1529176de50cc102fca70c30 Mon Sep 17 00:00:00 2001 From: Tima Gixe Date: Sun, 4 Sep 2022 18:53:45 +0300 Subject: [PATCH 2/4] move skipLibCheck to tsconfig.json --- package.json | 2 +- tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index bb0038b8..41df884c 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "verify:formatting": "prettier --check .", "verify:code-styles": "eslint .", "test": "jest --passWithNoTests", - "typecheck": "tsc --skipLibCheck" + "typecheck": "tsc" }, "dependencies": { "@docusaurus/core": "^0.0.0-5035", diff --git a/tsconfig.json b/tsconfig.json index 6f475698..44f6107b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ // This file is not used in compilation. It is here just for a nice editor experience. "extends": "@tsconfig/docusaurus/tsconfig.json", "compilerOptions": { - "baseUrl": "." + "baseUrl": ".", + "skipLibCheck": true } } From 3667e14c8e316194a289f6f1e5cf79b6415606e3 Mon Sep 17 00:00:00 2001 From: Tima Gixe Date: Mon, 5 Sep 2022 13:13:40 +0300 Subject: [PATCH 3/4] install tsc-files --- package.json | 3 ++- yarn.lock | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 41df884c..b98ee627 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,8 @@ "eslint-plugin-unicorn": "^27.0.0", "jest": "^28.1.0", "jest-environment-jsdom": "^28.1.0", - "prettier": "^2.6.2" + "prettier": "^2.6.2", + "tsc-files": "^1.1.3" }, "browserslist": { "production": [ diff --git a/yarn.lock b/yarn.lock index b102b54f..1b91ebea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11807,6 +11807,11 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== +tsc-files@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/tsc-files/-/tsc-files-1.1.3.tgz#ef4cfcb7affc9b90577d707a879dc53bb105be83" + integrity sha512-G6uXkTNofGU9EE1fYBaCpR72x/aqXW4PDAuznWj4JYlDwhcaKnUn4CiCHBMc89lDxLmikK+hhaEWLoTPEKKvXg== + tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" From 5dc7b7089301620af72fbea1fe609e904a63e9ea Mon Sep 17 00:00:00 2001 From: Tima Gixe Date: Mon, 5 Sep 2022 13:15:15 +0300 Subject: [PATCH 4/4] use tsc-files for type check on pre-commit step --- lefthook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lefthook.yml b/lefthook.yml index ec0bf193..4ad2a21f 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -33,7 +33,7 @@ pre-commit: type check: glob: '*.{ts,tsx}' exclude: '.docusaurus/|build/' - run: yarn typecheck + run: yarn tsc-files {staged_files} run tests: glob: '*.{js,jsx,ts,tsx}' exclude: '.docusaurus/|build/'