Skip to content

Commit bbce476

Browse files
committed
refactor: cleanup ts_project(isolated_typecheck) logic
1 parent 493e1f1 commit bbce476

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

ts/private/ts_project.bzl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,6 @@ See https://github.com/aspect-build/rules_ts/issues/361 for more details.
210210
use_tsc_for_js = len(js_outs) > 0
211211
use_tsc_for_dts = len(typings_outs) > 0
212212

213-
# Use a separate non-emitting action for type-checking when:
214-
# - a isolated typechecking action was explicitly requested
215-
# or
216-
# - not invoking tsc for output files at all
217-
use_isolated_typecheck = ctx.attr.isolated_typecheck or not (use_tsc_for_js or use_tsc_for_dts)
218-
219213
# Special case where there are no source outputs so we add output_types to the default outputs.
220214
default_outputs = output_sources if len(output_sources) else output_types
221215

@@ -229,8 +223,11 @@ See https://github.com/aspect-build/rules_ts/issues/361 for more details.
229223
transitive = transitive_inputs,
230224
)
231225

232-
# tsc action for type-checking
233-
if use_isolated_typecheck:
226+
# Use a separate non-emitting action for type-checking when:
227+
# - a isolated typechecking action was explicitly requested
228+
# or
229+
# - not invoking tsc for output files at all
230+
if ctx.attr.isolated_typecheck or not (use_tsc_for_js or use_tsc_for_dts):
234231
# The type-checking action still need to produce some output, so we output the stdout
235232
# to a .typecheck file that ends up in the typecheck output group.
236233
typecheck_output = ctx.actions.declare_file(ctx.attr.name + ".typecheck")

0 commit comments

Comments
 (0)