Skip to content

Commit 3c30f4b

Browse files
committed
fix typescript snippet lint
1 parent 4452b7d commit 3c30f4b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.scripts/lint_snippets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
PYRIGHT = PY_VENV / "bin" / "pyright"
7373
TSC = NODE_SDK / "node_modules" / "typescript" / "bin" / "tsc"
7474

75+
NODE = shutil.which("node")
7576
GO = shutil.which("go")
7677
CARGO = shutil.which("cargo")
7778
MAVEN = shutil.which("mvn")
@@ -950,13 +951,14 @@ def lint_typescript_batch(
950951
) -> list[LintIssue]:
951952
if not snippet_files:
952953
return []
953-
if not TSC.exists():
954+
if not TSC.exists() or not NODE:
954955
return []
955956
ws = _prepare_ts_workspace(snippet_files)
956957
# `tsc` emits diagnostics to stdout when --pretty=false and writes nothing
957958
# on success.
958959
result = subprocess.run(
959960
[
961+
NODE,
960962
str(TSC),
961963
"-p",
962964
str(ws / "tsconfig.json"),

0 commit comments

Comments
 (0)