Skip to content

Commit 4120265

Browse files
Make ts_library tsconfig.json extend root tsconfig (#6451)
* Make ts_library tsconfig.json extend root tsconfig * Remove tsetse settings from main tsconfig * Remove baseUrl and paths from ts_library tsconfig * Revert "Remove baseUrl and paths from ts_library tsconfig" Reverted since this PR should not change the tsconfig behavior (although I don't really think this change does affect behavior). This reverts commit 2a72331. * Lint bazel
1 parent d0bfa88 commit 4120265

File tree

4 files changed

+13
-34
lines changed

4 files changed

+13
-34
lines changed

BUILD.bazel

+9
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@
1313
# limitations under the License.
1414
# =============================================================================
1515

16+
load("@npm//@bazel/concatjs:index.bzl", "ts_config")
1617
load("//tools:tfjs_web_test.bzl", "grep_flag")
1718
load(":python_packages.bzl", "PYTHON_PACKAGES")
1819
load(":python_toolchain.bzl", "configure_python_toolchains")
1920

21+
package(default_visibility = ["//visibility:public"])
22+
2023
exports_files([
2124
"babel.config.json",
2225
"tsconfig.json",
@@ -25,6 +28,12 @@ exports_files([
2528
"tsconfig_ts_library.json",
2629
])
2730

31+
ts_config(
32+
name = "tsconfig_ts_library",
33+
src = "tsconfig_ts_library.json",
34+
deps = [":tsconfig.json"],
35+
)
36+
2837
configure_python_toolchains(
2938
platforms = PYTHON_PACKAGES,
3039
)

tools/defaults.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def ts_library(**kwargs):
2323
# have "incremental = true" because ts_library does not support incremental
2424
# builds at the level of the typescript compiler (it supports incrementally
2525
# rebuilding at the level of Bazel build targets).
26-
tsconfig = kwargs.pop("tsconfig", "@//:tsconfig_ts_library.json")
26+
tsconfig = kwargs.pop("tsconfig", "@//:tsconfig_ts_library")
2727

2828
# Use es2017 for esModule (prodmode) outputs by default. This is transpiled
2929
# down to es5 in tfjs_bundle.bzl. Use es5 for commonjs (devmode) outputs by

tsconfig.json

+1-11
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,7 @@
2323
"pretty": true,
2424
"noFallthroughCasesInSwitch": true,
2525
"allowUnreachableCode": false,
26-
"incremental": true,
27-
"plugins": [
28-
{
29-
"name": "@bazel/tsetse",
30-
"disabledRules": [
31-
"must-use-promises",
32-
"must-type-assert-json-parse",
33-
"ban-promise-as-condition"
34-
]
35-
}
36-
]
26+
"incremental": true
3727
},
3828
"include": [
3929
"**/src/"

tsconfig_ts_library.json

+2-22
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
11
{
2+
"extends": "./tsconfig.json",
23
"compilerOptions": {
3-
"module": "ES2015",
4-
"moduleResolution": "node",
5-
"noImplicitAny": true,
6-
"sourceMap": true,
7-
"inlineSources": true,
8-
"removeComments": false,
9-
"preserveConstEnums": true,
10-
"allowSyntheticDefaultImports": true,
11-
"declaration": true,
12-
"target": "es2017",
13-
"lib": [
14-
"es2017",
15-
"dom"
16-
],
17-
"noUnusedLocals": true,
18-
"noImplicitReturns": true,
19-
"noImplicitThis": true,
20-
"alwaysStrict": true,
21-
"noUnusedParameters": false,
22-
"pretty": true,
23-
"noFallthroughCasesInSwitch": true,
24-
"allowUnreachableCode": false,
4+
"incremental": false,
255
"baseUrl": ".",
266
"paths": {
277
"@tensorflow/*": [

0 commit comments

Comments
 (0)