From 9024f1c0a873f13fd2b4ad814468e244c59d0a98 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 26 Jun 2020 10:41:24 +0200 Subject: [PATCH] test: enable strict mode testing --- integration/common/src/helloworld/client.ts | 2 +- integration/express-engine-ivy-prerender/server.ts | 2 +- .../express-engine-ivy-prerender/tsconfig.json | 4 ++++ integration/express-engine-ivy/server.ts | 2 +- integration/express-engine-ivy/src/main.ts | 2 +- integration/express-engine-ivy/tsconfig.json | 4 ++++ integration/express-engine-ve/server.ts | 2 +- integration/express-engine-ve/src/main.ts | 2 +- integration/express-engine-ve/tsconfig.json | 4 ++++ integration/hapi-engine-ivy/src/main.ts | 2 +- integration/hapi-engine-ivy/tsconfig.json | 5 ++++- integration/hapi-engine-ve/src/main.ts | 2 +- integration/hapi-engine-ve/tsconfig.json | 5 ++++- package.json | 4 ++-- yarn.lock | 14 ++++++++++---- 15 files changed, 40 insertions(+), 16 deletions(-) diff --git a/integration/common/src/helloworld/client.ts b/integration/common/src/helloworld/client.ts index b2ecbecac..ace0d4d72 100644 --- a/integration/common/src/helloworld/client.ts +++ b/integration/common/src/helloworld/client.ts @@ -12,6 +12,6 @@ import {enableProdMode} from '@angular/core'; import {platformBrowser} from '@angular/platform-browser'; import {HelloWorldModuleNgFactory} from './app.ngfactory'; -window['doBootstrap'] = function() { +(window as any)['doBootstrap'] = function() { platformBrowser().bootstrapModuleFactory(HelloWorldModuleNgFactory); }; diff --git a/integration/express-engine-ivy-prerender/server.ts b/integration/express-engine-ivy-prerender/server.ts index 105d68f74..a4ad6d0e1 100644 --- a/integration/express-engine-ivy-prerender/server.ts +++ b/integration/express-engine-ivy-prerender/server.ts @@ -9,7 +9,7 @@ import { APP_BASE_HREF } from '@angular/common'; import { existsSync } from 'fs'; // The Express app is exported so that it can be used by serverless Functions. -export function app() { +export function app(): express.Express { const server = express(); const distFolder = join(process.cwd(), 'dist/express-engine-ivy-prerender/browser'); const indexHtml = existsSync(join(distFolder, 'src/home.html')) ? 'src/home.html' : 'index.html'; diff --git a/integration/express-engine-ivy-prerender/tsconfig.json b/integration/express-engine-ivy-prerender/tsconfig.json index 30956ae7e..c8628ed5a 100644 --- a/integration/express-engine-ivy-prerender/tsconfig.json +++ b/integration/express-engine-ivy-prerender/tsconfig.json @@ -3,6 +3,10 @@ "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, "sourceMap": true, "declaration": false, "downlevelIteration": true, diff --git a/integration/express-engine-ivy/server.ts b/integration/express-engine-ivy/server.ts index 98c6bfb98..9887ea7ad 100644 --- a/integration/express-engine-ivy/server.ts +++ b/integration/express-engine-ivy/server.ts @@ -9,7 +9,7 @@ import { APP_BASE_HREF } from '@angular/common'; import { existsSync } from 'fs'; // The Express app is exported so that it can be used by serverless Functions. -export function app() { +export function app(): express.Express { const server = express(); const distFolder = join(process.cwd(), 'dist/express-engine-ivy/browser'); const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index'; diff --git a/integration/express-engine-ivy/src/main.ts b/integration/express-engine-ivy/src/main.ts index bc161fc92..f72426c6c 100644 --- a/integration/express-engine-ivy/src/main.ts +++ b/integration/express-engine-ivy/src/main.ts @@ -8,7 +8,7 @@ if (environment.production) { enableProdMode(); } -window['doBootstrap'] = () => { +(window as any)['doBootstrap'] = () => { platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err)); }; diff --git a/integration/express-engine-ivy/tsconfig.json b/integration/express-engine-ivy/tsconfig.json index 30956ae7e..c8628ed5a 100644 --- a/integration/express-engine-ivy/tsconfig.json +++ b/integration/express-engine-ivy/tsconfig.json @@ -3,6 +3,10 @@ "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, "sourceMap": true, "declaration": false, "downlevelIteration": true, diff --git a/integration/express-engine-ve/server.ts b/integration/express-engine-ve/server.ts index 8df9738ab..2f258a435 100644 --- a/integration/express-engine-ve/server.ts +++ b/integration/express-engine-ve/server.ts @@ -9,7 +9,7 @@ import { APP_BASE_HREF } from '@angular/common'; import { existsSync } from 'fs'; // The Express app is exported so that it can be used by serverless Functions. -export function app() { +export function app(): express.Express { const server = express(); const distFolder = join(process.cwd(), 'dist/express-engine-ve/browser'); const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index'; diff --git a/integration/express-engine-ve/src/main.ts b/integration/express-engine-ve/src/main.ts index bc161fc92..f72426c6c 100644 --- a/integration/express-engine-ve/src/main.ts +++ b/integration/express-engine-ve/src/main.ts @@ -8,7 +8,7 @@ if (environment.production) { enableProdMode(); } -window['doBootstrap'] = () => { +(window as any)['doBootstrap'] = () => { platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err)); }; diff --git a/integration/express-engine-ve/tsconfig.json b/integration/express-engine-ve/tsconfig.json index e4816a58e..8117f1da9 100644 --- a/integration/express-engine-ve/tsconfig.json +++ b/integration/express-engine-ve/tsconfig.json @@ -3,6 +3,10 @@ "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, "sourceMap": true, "declaration": false, "downlevelIteration": true, diff --git a/integration/hapi-engine-ivy/src/main.ts b/integration/hapi-engine-ivy/src/main.ts index bc161fc92..f72426c6c 100644 --- a/integration/hapi-engine-ivy/src/main.ts +++ b/integration/hapi-engine-ivy/src/main.ts @@ -8,7 +8,7 @@ if (environment.production) { enableProdMode(); } -window['doBootstrap'] = () => { +(window as any)['doBootstrap'] = () => { platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err)); }; diff --git a/integration/hapi-engine-ivy/tsconfig.json b/integration/hapi-engine-ivy/tsconfig.json index c3eb1b95f..c8628ed5a 100644 --- a/integration/hapi-engine-ivy/tsconfig.json +++ b/integration/hapi-engine-ivy/tsconfig.json @@ -3,6 +3,10 @@ "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, "sourceMap": true, "declaration": false, "downlevelIteration": true, @@ -10,7 +14,6 @@ "module": "esnext", "moduleResolution": "node", "importHelpers": true, - "skipLibCheck": true, "target": "es2015", "typeRoots": [ "node_modules/@types" diff --git a/integration/hapi-engine-ve/src/main.ts b/integration/hapi-engine-ve/src/main.ts index bc161fc92..f72426c6c 100644 --- a/integration/hapi-engine-ve/src/main.ts +++ b/integration/hapi-engine-ve/src/main.ts @@ -8,7 +8,7 @@ if (environment.production) { enableProdMode(); } -window['doBootstrap'] = () => { +(window as any)['doBootstrap'] = () => { platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err)); }; diff --git a/integration/hapi-engine-ve/tsconfig.json b/integration/hapi-engine-ve/tsconfig.json index d8447a3f9..8117f1da9 100644 --- a/integration/hapi-engine-ve/tsconfig.json +++ b/integration/hapi-engine-ve/tsconfig.json @@ -3,6 +3,10 @@ "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, "sourceMap": true, "declaration": false, "downlevelIteration": true, @@ -10,7 +14,6 @@ "module": "esnext", "moduleResolution": "node", "importHelpers": true, - "skipLibCheck": true, "target": "es2015", "typeRoots": [ "node_modules/@types" diff --git a/package.json b/package.json index 34ee7bd1b..59f774f96 100644 --- a/package.json +++ b/package.json @@ -66,12 +66,12 @@ "@hapi/hapi": "^18.4.0", "@schematics/angular": "^10.0.0", "@types/browser-sync": "^2.26.1", - "@types/express": "4.17.6", + "@types/express": "~4.17.6", "@types/fs-extra": "^9.0.0", "@types/hapi__hapi": "^19.0.0", "@types/hapi__inert": "^5.2.0", "@types/jasmine": "^3.4.4", - "@types/node": "^12.11.1", + "@types/node": "12.11.1", "@types/shelljs": "^0.8.6", "browser-sync": "^2.26.7", "domino": "^2.1.2", diff --git a/yarn.lock b/yarn.lock index a9da60638..6fe25835a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1577,14 +1577,15 @@ integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== "@types/express-serve-static-core@*": - version "4.17.5" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.5.tgz#a00ac7dadd746ae82477443e4d480a6a93ea083c" - integrity sha512-578YH5Lt88AKoADy0b2jQGwJtrBxezXtVe/MBqWXKZpqx91SnC0pVkVCcxcytz3lWW+cHBYDi3Ysh0WXc+rAYw== + version "4.17.8" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.8.tgz#b8f7b714138536742da222839892e203df569d1c" + integrity sha512-1SJZ+R3Q/7mLkOD9ewCBDYD2k0WyZQtWYqF/2VvoNN2/uhI49J9CDN4OAm+wGMA0DbArA4ef27xl4+JwMtGggw== dependencies: "@types/node" "*" + "@types/qs" "*" "@types/range-parser" "*" -"@types/express@4.17.6": +"@types/express@~4.17.6": version "4.17.6" resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.6.tgz#6bce49e49570507b86ea1b07b806f04697fac45e" integrity sha512-n/mr9tZI83kd4azlPG5y997C/M4DNABK9yErhFM6hKdym4kkmd9j0vtsJyjFIwfRBxtrxZtAfGZCNRIBMFLK5w== @@ -1730,6 +1731,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.37.tgz#cb4782d847f801fa58316da5b4801ca3a59ae790" integrity sha512-4mXKoDptrXAwZErQHrLzpe0FN/0Wmf5JRniSVIdwUrtDf9wnmEV1teCNLBo/TwuXhkK/bVegoEn/wmb+x0AuPg== +"@types/node@12.11.1": + version "12.11.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.11.1.tgz#1fd7b821f798b7fa29f667a1be8f3442bb8922a3" + integrity sha512-TJtwsqZ39pqcljJpajeoofYRfeZ7/I/OMUQ5pR4q5wOKf2ocrUvBAZUMhWsOvKx3dVc/aaV5GluBivt0sWqA5A== + "@types/object-path@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@types/object-path/-/object-path-0.11.0.tgz#0b744309b2573dc8bf867ef589b6288be998e602"