From 31c0afbd613d61dca1efcdbe6827b3c5723c1d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 21 Mar 2019 12:48:58 +0100 Subject: [PATCH 1/2] feat(build): enable TSC option "skipLibCheck" Disable type checking of declaration files. Declaration files are typically shipped by our dependencies, we cannot apply our compiler checks (e.g. noImplicitAny) on them. --- packages/build/config/tsconfig.common.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/build/config/tsconfig.common.json b/packages/build/config/tsconfig.common.json index 306a2ebaac19..8117cacd6ef7 100644 --- a/packages/build/config/tsconfig.common.json +++ b/packages/build/config/tsconfig.common.json @@ -7,6 +7,7 @@ "strictNullChecks": true, "resolveJsonModule": true, "strictBindCallApply": true, + "skipLibCheck": true, "lib": ["es2018", "dom", "esnext.asynciterable"], "module": "commonjs", From c4086b1bac75ddbf06ced228e8eb5f5f7f01d6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 21 Mar 2019 12:55:48 +0100 Subject: [PATCH 2/2] fix(build): remove "dom" from the list of global libraries Historically, we were including "dom" because it was required by supertest's type declarations to pass the compilation. Now that we are not type-checking declaration files, we don't need "dom" library any more. Please note that "dom" library is for HTML/Browser environment only, no Node.js code should be depending on DOM types, e.g. the global `Request` object provided by browsers. --- packages/build/config/tsconfig.common.json | 2 +- packages/cli/generators/project/templates/tsconfig.json.ejs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/build/config/tsconfig.common.json b/packages/build/config/tsconfig.common.json index 8117cacd6ef7..eb58cee2e096 100644 --- a/packages/build/config/tsconfig.common.json +++ b/packages/build/config/tsconfig.common.json @@ -9,7 +9,7 @@ "strictBindCallApply": true, "skipLibCheck": true, - "lib": ["es2018", "dom", "esnext.asynciterable"], + "lib": ["es2018", "esnext.asynciterable"], "module": "commonjs", "moduleResolution": "node", "target": "es2017", diff --git a/packages/cli/generators/project/templates/tsconfig.json.ejs b/packages/cli/generators/project/templates/tsconfig.json.ejs index e89fc7f68e4f..8ffddb55b332 100644 --- a/packages/cli/generators/project/templates/tsconfig.json.ejs +++ b/packages/cli/generators/project/templates/tsconfig.json.ejs @@ -15,8 +15,9 @@ "noImplicitAny": true, "strictNullChecks": true, "resolveJsonModule": true, + "skipLibCheck": true, - "lib": ["es2018", "dom", "esnext.asynciterable"], + "lib": ["es2018", "esnext.asynciterable"], "module": "commonjs", "moduleResolution": "node", "target": "es2017",