Skip to content

Commit

Permalink
refactor: fix remaining typescript strict flag failures (#30993)
Browse files Browse the repository at this point in the history
Fixes the remaining TypeScript --strict flag failures for source
files which are not part of any specific release package.

PR Close #30993
  • Loading branch information
devversion authored and mhevery committed Jul 18, 2019
1 parent 012b535 commit a27c5dd
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions packages/examples/common/pipes/ts/async_pipe.ts
Expand Up @@ -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);
});
}
3 changes: 3 additions & 0 deletions packages/http/BUILD.bazel
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions packages/platform-webworker/BUILD.bazel
Expand Up @@ -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",
Expand Down
28 changes: 17 additions & 11 deletions packages/tsconfig.json
@@ -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,
Expand All @@ -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,
Expand All @@ -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"
]
Expand Down

0 comments on commit a27c5dd

Please sign in to comment.