Skip to content

Ability for compiler host to provide resolution mode for file and say it supports impledNodeFormatΒ #59939

Closed as not planned
@dsherret

Description

@dsherret

πŸ” Search Terms

resolution mode compiler host

βœ… Viability Checklist

⭐ 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

  1. Deno where we know if a file is CJS or ESM already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions