From 6a778cb72f12416e6b5fe6a5326859c4a39d4608 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 26 Jan 2024 08:34:53 -0800 Subject: [PATCH] chore: enable lib checks The 'skipLibCheck=always' was added in https://github.com/aspect-build/rules_ts/pull/371 without any explanation of why we'd want that setting for rules_ts itself. This is a prefactor for the regression test of #516 - and in general we should be testing with the 'stricter' setting to make more assurance that the rules behave correctly. --- .bazelrc | 3 --- .bazelrc.common | 10 +++------- examples/connect_node/tsconfig.json | 4 +++- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.bazelrc b/.bazelrc index ee21c57f..4b89e7bf 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,9 +1,6 @@ # import common bazelrc settings used in this repository and in nested workspaces import %workspace%/.bazelrc.common -# passes an argument `--skipLibCheck` to *every* spawn of tsc -build --@aspect_rules_ts//ts:skipLibCheck=always - # Disable lockfile for now. It is unstable. # https://github.com/bazelbuild/bazel/issues/19026 # https://github.com/bazelbuild/bazel/issues/19621 diff --git a/.bazelrc.common b/.bazelrc.common index a0347b08..c2b8d98b 100644 --- a/.bazelrc.common +++ b/.bazelrc.common @@ -70,13 +70,9 @@ build:macos --nolegacy_external_runfiles build:freebsd --nolegacy_external_runfiles build:openbsd --nolegacy_external_runfiles -# TODO: switch to 'common' once https://github.com/bazelbuild/bazel/pull/19363 is landed and available in Bazel -build --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig -fetch --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig -query --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig -build --@aspect_rules_ts//ts:default_to_tsc_transpiler -fetch --@aspect_rules_ts//ts:default_to_tsc_transpiler -query --@aspect_rules_ts//ts:default_to_tsc_transpiler +# Note: 'common' for custom flags requires Bazel 6.4.0 or greater +common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig +common --@aspect_rules_ts//ts:default_to_tsc_transpiler # Turn on --incompatible_strict_action_env which was on by default # in Bazel 0.21.0 but turned off again in 0.22.0. Follow diff --git a/examples/connect_node/tsconfig.json b/examples/connect_node/tsconfig.json index 8e1f03d0..c09da5ad 100644 --- a/examples/connect_node/tsconfig.json +++ b/examples/connect_node/tsconfig.json @@ -2,6 +2,8 @@ "compilerOptions": { "lib": ["ES2015"], "moduleResolution": "node", - "module": "ES2020" + "module": "ES2020", + // TODO: enable lib check here: repair broken type-check + "skipLibCheck": true } }