Latest Results
fix(parser): do not treat TsImportEquals as ESM module syntax
Fixes #9694
## Problem
`import x = require('mod')` (TsImportEquals) was incorrectly marking a file
as an ECMAScript module, even though this is TypeScript's CommonJS-style
import syntax, not an ESM import. With module:nodenext, TypeScript transforms
this to a _createRequire call, treating it as a script/CommonJS.
## Solution
- Remove enter_import_module_context() call when parsing TsImportEquals
- Update has_module_syntax() to return false for TsImportEquals,
TsExportAssignment, and TsNamespaceExport (these are all TypeScript-
specific constructs, not ESM syntax)
- `export import`, `export =`, and `export as namespace` already trigger
module context via the export keyword parsing at line 406-409, so
those cases still work correctlydajiaohuang:fix/9694-ts-import-equals-module-detection Latest Branches
0%
dajiaohuang:fix/9694-ts-import-equals-module-detection -2%
dajiaohuang:fix/9655-dynamic-musl-path 0%
© 2026 CodSpeed Technology