ReviewOS

home-lang/home

fix(ts): report dependent-option diagnostics at every explicit config key

#956
Closed glennmichael123 opened this 7 days ago ·
7 days ago

Reproducer

In a tsconfig with explicit allowJs: false and checkJs: true, TypeScript 5.7.3 emits TS5052 at both option keys, in JSON source order. Reversing the keys reverses the diagnostic anchors. Home emitted only the first. This is part of #846’s negative config-admission boundary.

Root cause

TsConfig.validate generated one dependency diagnostic and then chose only the first matching compiler-option key. TypeScript’s createOptionDiagnosticInObjectLiteralSyntax visits every matching property assignment. The shared Home location pass must expand TS5052/TS5069 diagnostics to each explicitly present relevant key, retain a single fallback at compilerOptions when neither key exists locally, and keep message ownership correct.

Acceptance

Exact TypeScript CLI streams and exit 2 for both key orders, plus tsconfig unit assertions for locations. Preserve checkJs implying allowJs only when allowJs is omitted; do not alter source-admission behavior. Run guarded tsconfig, stream, and tsc_main suites, then push issue-linked conventional commits as glennmichael123 without coauthors.

7 days ago

Completed on origin/main in 0426dda and d8bada6, authored/committed as glennmichael123 without coauthors. TypeScript 5.7.3 emits TS5052 at both explicit allowJs and checkJs keys; Home now expands shared TS5052/TS5069 dependent-option diagnostics to every matching local key in JSON source order, with a single compilerOptions fallback when neither key is local. Both key orders match TypeScript exactly in diagnostic text, positions, and exit 2. The parallel JSX-without-allowJs control matches TS7016, preserving source-admission behavior. Guarded full tsconfig, exact test-tsc-streams, and tsc_main targets exited 0 below the 3,840 MB cap (latest peaks 242, 2,123, and 2,266 MB). Zig formatting and diff hygiene passed. #846 remains open for broader admission/LSP acceptance.

Sign in to comment on this issue.