Skip to content

Commit 2637a0c

Browse files
crisbetoalxhub
authored andcommitted
build: enable strict templates and type checking of host bindings (#60481)
Enables strict templates and type checking of host bindings against our own code. PR Close #60481
1 parent ceb7a93 commit 2637a0c

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

modules/tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
"skipDefaultLibCheck": true,
2121
"skipLibCheck": true,
2222
"target": "es5",
23-
"types": ["angular"],
23+
"types": ["angular"]
2424
},
2525
"exclude": [
2626
"payload_tests",
2727
"playground/",
2828
"benchmarks/"
2929
],
3030
"angularCompilerOptions": {
31-
"skipTemplateCodegen": true
31+
"strictTemplates": true,
32+
"skipTemplateCodegen": true,
33+
"typeCheckHostBindings": true
3234
}
3335
}

packages/bazel/test/ngc-wrapped/ivy_enabled/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jasmine_node_test(
2828
ng_module(
2929
name = "test_module_warnings_lib",
3030
srcs = ["test_module_warnings.ts"],
31-
strict_templates = True,
3231
tags = [],
3332
deps = ["//packages/core"],
3433
)

packages/core/test/playground/zone-signal-input/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ load("//tools:defaults.bzl", "app_bundle", "http_server", "ng_module")
33
ng_module(
44
name = "test_lib",
55
srcs = ["index.ts"],
6-
strict_templates = True,
76
tags = ["no-cache"],
87
deps = [
98
"//packages/core",

packages/tsconfig-build.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,9 @@
3333
},
3434
"bazelOptions": {
3535
"suppressTsconfigOverrideWarnings": true
36+
},
37+
"angularCompilerOptions": {
38+
"strictTemplates": true,
39+
"typeCheckHostBindings": true
3640
}
3741
}

packages/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
"bazelOptions": {
3838
"suppressTsconfigOverrideWarnings": true
3939
},
40+
"angularCompilerOptions": {
41+
"strictTemplates": true,
42+
"typeCheckHostBindings": true
43+
},
4044
"exclude": [
4145
"common/locales",
4246
"compiler-cli/integrationtest",

tools/defaults.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps
184184
deps = deps,
185185
compiler = _INTERNAL_NG_MODULE_COMPILER,
186186
ng_xi18n = _INTERNAL_NG_MODULE_XI18N,
187+
strict_templates = True,
187188
# `module_name` is used for AMD module names within emitted JavaScript files.
188189
module_name = module_name,
189190
# `package_name` can be set to allow for the Bazel NodeJS linker to run. This

0 commit comments

Comments
 (0)