Commits
Click on a commit to change the comparison rangefeat(parser): implement unambiguous module parsing for JS/TS files
This change implements speculative/unambiguous parsing for `.js`, `.jsx`, `.ts`,
and `.tsx` files. Instead of assuming these files are modules or scripts upfront,
we now parse them with `ModuleKind::Unambiguous` and upgrade to module mode when
ESM syntax (import/export/import.meta) is detected.
Key changes:
- Add `ModuleKind::Unambiguous` variant for speculative parsing
- Parser defers top-level await errors until module type is resolved
- ESM syntax detection triggers upgrade from unambiguous to module
- Vue loader upgrades unambiguous scripts to module mode
- Linter tests updated to use explicit ESM extensions (.mjs/.mts) where needed
This enables better handling of files where the module type isn't known ahead of
time, improving compatibility with real-world JavaScript codebases.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>