ReviewOS

home-lang/home

fix(ts): honor CLI --isolatedModules false over tsconfig true

#937
Closed glennmichael123 opened this 8 days ago ·
8 days ago

Reproduction

Use ambient.d.ts: declare module "pkg" { export const enum Mode { One = 1 } }. Use a two-line main.ts with import pkg = require("pkg"); on line 1 and export const value = pkg.Mode.One; on line 2. The tsconfig enables isolatedModules, noEmit, and includes both files.

Run home-tsc --project tsconfig.json --pretty false --isolatedModules false. At the current main (including 28989d9), Home still reports TS2748 at main.ts(2,22) and exits 1. Pinned TypeScript 6.0.3 exits 0 with no diagnostic for the same command. An otherwise identical config with isolatedModules: false also exits 0 under Home, so this is a command-line override/config-precedence gap rather than the ambient enum export-fact gap fixed in #844.

Acceptance

The explicit CLI false value must override the true tsconfig value, matching TypeScript; preserve the existing TS2748 when the option remains enabled. Audit related boolean overrides without assuming they share the same cause.

8 days ago

Fixed and pushed directly to origin/main as b2282cf4a, under glennmichael123 with no coauthors (3 files). --isolatedModules true|false is now parsed as a typed tri-state option, applied to tsconfig and CompileOptions, and honored in the driver with or without a parsed config.

Guarded verification: ts_cli 89/89, ts_driver 222/222, tsc_main 62/62; production home-tsc rebuilt. The formerly failing --project tsconfig.json --isolatedModules false command now exits 0, matching pinned TS 6.0.3 and native TS 7.0.2. The reverse --isolatedModules true over config false reports the same TS2748 position/message as both controls. Unoverridden config true still reports TS2748. Zig format and diff checks pass.

Audit scope: related supported booleans such as noLib, noResolve, skipLibCheck, and verbatimModuleSyntax already have typed parser/config paths; this commit does not claim that every unimplemented CLI flag is supported. The general unknown-flag fallback remains separate from this focused issue.

Sign in to comment on this issue.