diff --git a/typescript/src/main.ts b/typescript/src/main.ts index bd9b998..bbb31f6 100644 --- a/typescript/src/main.ts +++ b/typescript/src/main.ts @@ -220,7 +220,7 @@ function compilerConfigFromTsconfig(configPath: string): ts.ParsedCommandLine { if (config.error !== undefined) { throw new Error(formatDiagnostics([config.error])); } - const parsed = ts.parseJsonConfigFileContent(config.config, ts.sys, path.dirname(configPath)); + const parsed = ts.parseJsonConfigFileContent(config.config, ts.sys, path.dirname(configPath), undefined, configPath); if (parsed.errors.length > 0) { throw new Error(formatDiagnostics(parsed.errors)); } diff --git a/typescript/test.sh b/typescript/test.sh index fa63eaf..4861377 100755 --- a/typescript/test.sh +++ b/typescript/test.sh @@ -126,6 +126,33 @@ test("closure properties", () => { }); TS +mkdir -p "$TMPDIR/node_modules/@types/local-env" +cat > "$TMPDIR/node_modules/@types/local-env/index.d.ts" <<'TS' +declare const LOCAL_ENV_FLAG: boolean; +TS + +cat > "$TMPDIR/node_modules/@types/local-env/package.json" <<'JSON' +{ + "name": "@types/local-env", + "version": "1.0.0", + "types": "index.d.ts" +} +JSON + +cat > "$TMPDIR/tsconfig.json" <<'JSON' +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "strict": true, + "skipLibCheck": true, + "types": ["local-env"] + }, + "include": ["src/**/*", "tests/**/*"] +} +JSON + npm --prefix "$ROOT/typescript" install >/dev/null npm --prefix "$ROOT/typescript" run --silent typecheck uv run --project "$ROOT" python "$ROOT/evaluate.py" \