Closed as not planned
Closed as not planned
Description
π Search Terms
resolution mode compiler host
β Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
β Suggestion
Recent changes in TS 5.6 (ex. #58825) have meant that typescript more conditionally checks sourceFile.impliedNodeFormat
. In Deno, we do all the resolution to tell if something is CJS or ESM and this property will always be set accordingly.
Would you be open to a PR that changes some of this code to instead ask the compiler host for the implied node format and the default implementation of that would use what's currently done in TypeScript? (I'm working around this issue in the meantime, but I'd rather not do so many custom changes just for this, which is why I'm opening this issue)
π Motivating Example
--
π» Use Cases
- Deno where we know if a file is CJS or ESM already.
Metadata
Metadata
Assignees
Labels
No labels