Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptESM CJS interopSingle-choice MCQ

Under `module: nodenext`, a default import of a CommonJS `export =` module compiles even though `esModuleInterop` was never set in the config. What explains this?

// legacy.cts: // const v = { foo: 1 }; // export = v; // use.mts: import legacy from "./legacy.cjs"; const x: number = legacy.foo;