TypeScript 5.7.3 differential
In an admitted JavaScript owner, /** @type {Payload} */ module.exports = { count: 1, label: 'ready' } with Payload = { readonly count: number, label?: string } must publish the declared type to TypeScript importers even when checkJs is false. Home published only the inferred object literal type, losing readonly and optionality in the importer.
TypeScript also accepts module.exports = { count: 1 }; module.exports.count = 2; and the analogous later exports.count = 2. Home incorrectly emitted TS2309, which is for conflicting TypeScript export = declarations, not ordinary CommonJS augmentation.
Acceptance
- Preserve the source owner's JSDoc declaration through the checked Program schema in both
checkJsmodes, without adding owner diagnostics whencheckJsis off. - Keep the real
export =exclusivity and declaration-emit rules. - Add exact TypeScript 5.7.3 CLI stream fixtures and checker/Program regressions; run guarded sequential Zig suites.
- Record any additional CommonJS expando gaps separately rather than suppressing their diagnostics blindly.