Commit e651054
committed
chore: enable isolatedModules
Moving the ambient const enums into real modules removed the last thing
standing in the way: tsc --noEmit --isolatedModules reports 244 errors on
main (all TS2748, 'Cannot access ambient const enums') and none once they
are real modules.
This is not emit-neutral. With isolatedModules on, tsc stops inlining const
enums and emits them as runtime objects, so 33 files change: consumers go
from a baked-in literal to a property lookup, and lib/constants.js now emits
ShouldMigrate, NativePlatformStatus, DebugTools, TrackActionNames,
BuildStates and PlatformTypes. The values are unchanged - verified at
runtime - and the suite is unchanged at 1513 passing, with the CLI still
rendering help and reporting its version.
That change is arguably the point. oxc and esbuild cannot inline a const
enum across files, so today tsc's output and every other transpiler's output
disagree for exactly those six. Now they agree.
It also means the const modifier on the remaining ten declarations no longer
buys inlining, so it is decorative; converting them to plain enum is a
sensible follow-up.1 parent 98a0dd8 commit e651054
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
0 commit comments