ReviewOS

home-lang/home

fix(ts): render absolute resolved path in noResolve TS7016 diagnostic

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

Parent: #846. Reproducer: packages/ts_cli/testdata/issue846-closure/tsconfig-no-resolve.json (files: main.ts, root.js; allowJs/checkJs/strict/noEmit/noResolve). main.ts imports bridge.js, which is physically resolvable but not admitted because noResolve is on. The root.js JSDoc type error remains admitted.

TypeScript 5.7.3 and Home both emit TS7016 at main.ts:1:23 and TS2322 at root.js:2:14, exit 2. The TS7016 diagnostic text differs: TypeScript prints the absolute resolved path to bridge.js (under this fixture directory), whereas Home prints only bridge.js. This is a real diagnostic parity failure, not an admission failure. The sibling tsconfig.json, tsconfig-no-checkjs.json, and tsconfig-implicit-checkjs.json modes already match TypeScript and are locked in test-tsc-streams.

The CLI resolver adapter passes the resolver path through ExternalResolver.Resolution.path; that same path is used both to locate/identify Program sources and to render the TS7016 suffix. Investigate a principled path representation or separate diagnostic display path so CLI uses the canonical absolute path without breaking source admission, virtual-file cases, or relative import resolution. Do not string-rewrite final diagnostics or blanket-admit excluded JS.

Acceptance: exact TypeScript diagnostic text/order/exit for the noResolve fixture, plus controls for admitted imports and virtual relative paths; guarded checker/Program/CLI tests.

7 days ago

Fixed and pushed to origin/main in 2c037e5 under glennmichael123 without coauthors. ExternalResolver.Resolution now carries a diagnostic-only canonical path distinct from the resolver/Program identity path. The CLI adapter asks its filesystem for realpath only for unadmitted relative JS implementations; virtual paths and admitted-source lookup retain the original path. TypeScript 5.7.3 and freshly built Home now match the noResolve fixture byte-for-byte: TS7016 at main.ts:1:23 with the absolute bridge.js path, TS2322 at root.js:2:14, exit 2. Exact test-tsc-streams, targeted checker, full tsc_main, and full Program suites exited 0 under serial 3,840 MB guarded runs. Parent #846 remains open for its other acceptance cases.

Sign in to comment on this issue.