refactor: fix remaining typescript strict flag failures (#30993)

Fixes the remaining TypeScript --strict flag failures for source
files which are not part of any specific release package.

PR Close #30993
This commit is contained in:
Paul Gschwendtner 2019-06-14 09:29:04 +02:00 committed by Miško Hevery
parent 012b535147
commit a27c5dd740
5 changed files with 27 additions and 14 deletions

View File

@ -112,7 +112,7 @@ export class ExpandingRowHost implements AfterViewInit,
* function around. This enables us to detach the click listener when
* component is destroyed.
*/
private handleRootMouseUpBound: EventListenerObject = this.handleRootMouseUp.bind(this);
private handleRootMouseUpBound = this.handleRootMouseUp.bind(this);
/**
* 16px is the margin animation we have on cfc-expanding-row component.

View File

@ -63,6 +63,7 @@ function setInterval(fn: Function, delay: number) {
while (rootZone.parent) {
rootZone = rootZone.parent;
}
rootZone.run(
() => { window.setInterval(function() { zone.run(fn, this, arguments as any); }, delay); });
rootZone.run(() => {
window.setInterval(function(this: unknown) { zone.run(fn, this, arguments as any); }, delay);
});
}

View File

@ -10,6 +10,9 @@ ng_module(
"src/**/*.ts",
],
),
# Disable building with strict compatibility as the http package is no longer
# maintained and therefore not needed to be made compatible with --strict.
tsconfig = "//packages:tsconfig-build-no-strict",
deps = [
"//packages/core",
"//packages/platform-browser",

View File

@ -10,6 +10,9 @@ ng_module(
"src/**/*.ts",
],
),
# Disable building with strict compatibility as the platform-webworker package is
# deprecated and therefore it is not needed to make it compatible with --strict.
tsconfig = "//packages:tsconfig-build-no-strict",
deps = [
"//packages:types",
"//packages/common",

View File

@ -1,6 +1,8 @@
{
"compilerOptions": {
"baseUrl": ".",
// Setting the "baseUrl" to a different directory than "packages/" because otherwise
// packages like the native "http" module are resolved to the Angular "http" package.
"baseUrl": "..",
"declaration": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
@ -12,10 +14,10 @@
"noImplicitAny": true,
"noFallthroughCasesInSwitch": true,
"paths": {
"selenium-webdriver": ["../node_modules/@types/selenium-webdriver/index.d.ts"],
"rxjs/*": ["../node_modules/rxjs/*"],
"@angular/*": ["./*"],
"e2e_util/*": ["../modules/e2e_util/*"]
"selenium-webdriver": ["./node_modules/@types/selenium-webdriver/index.d.ts"],
"rxjs/*": ["./node_modules/rxjs/*"],
"@angular/*": ["./packages/*"],
"e2e_util/*": ["./modules/e2e_util/*"]
},
"rootDir": ".",
"inlineSourceMap": true,
@ -34,13 +36,17 @@
"compiler-cli/integrationtest",
"core/schematics",
"elements/schematics",
// Do not build the example e2e spec files since those require custom typings and
// aren't required to build all packages.
"examples/**/e2e_test/*",
// Exclude the "main.ts" files for each example group because this file is used by
// Bazel to launch the devserver and uses AOT compilation.
"examples/**/main.ts",
// Do not build the example package because there are no legacy tests that need to be
// built. Additionally the examples are not made compatible with the "strict" option.
"examples/**",
// Http doesn't need to built since it is no longer maintained and
// will be removed eventually. See: FW-1392.
"http/**",
"platform-server/integrationtest",
// The webworker packages have deprecated and are not made compatible with the
// strict flag. Until these packages are removed, we exclude them here.
"platform-webworker/**",
"platform-webworker-dynamic/**",
"router/test/aot_ngsummary_test",
"zone.js"
]