Skip to content

Commit cd8520d

Browse files
committed
fix(typescript): include extended tsconfigs in _TsConfigInfo
Allows ts_project to work with extra tsconfig indirections Fixes #1754
1 parent f6c0706 commit cd8520d

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

packages/typescript/src/internal/ts_project.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _ts_project_impl(ctx):
123123
collect_default = True,
124124
),
125125
),
126-
_TsConfigInfo(tsconfigs = depset([ctx.file.tsconfig], transitive = [
126+
_TsConfigInfo(tsconfigs = depset([ctx.file.tsconfig] + ctx.files.extends, transitive = [
127127
dep[_TsConfigInfo].tsconfigs
128128
for dep in ctx.attr.deps
129129
if _TsConfigInfo in dep

packages/typescript/test/ts_project/a/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ load("@npm_bazel_typescript//:index.bzl", "ts_project")
22

33
ts_project(
44
composite = True,
5-
extends = ["//packages/typescript/test/ts_project:tsconfig-base.json"],
5+
extends = [
6+
":tsconfig-extended.json",
7+
"//packages/typescript/test/ts_project:tsconfig-base.json",
8+
],
69
# Intentionally not syncing this option from tsconfig, to test validator suppression
710
# source_map = True,
811
validate = False,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// This file is an extra hop of indirection, regression test for #1754
2+
{
3+
"extends": "../tsconfig-base"
4+
}

packages/typescript/test/ts_project/a/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig-base.json",
2+
"extends": "./tsconfig-extended.json",
33
"compilerOptions": {
44
"sourceMap": true,
55
// WORKAROUND https://github.com/microsoft/TypeScript/issues/37378

0 commit comments

Comments
 (0)