Skip to content

Enable esModuleInterop to use default imports instead of whole module imports #1511

Closed
@trivikr

Description

@trivikr

Is your feature request related to a problem? Please describe.
TypeScript picked up whole module imports import * as for transpiling es6 imports to commonjs.
Now it recommends using default imports by setting esModuleInterop: true in TSConfig (it's set to true by default on running tsc --init)

More details: https://itnext.io/great-import-schism-typescript-confusion-around-imports-explained-d512fc6769c2

Describe the solution you'd like
Set esModuleInterop: true in tsconfig, and use default imports instead of whole module imports

Describe alternatives you've considered
Sticking with whole module imports which is more code, difficult to read, not spec-compliant and creates friction between typescript and babel communities.

Additional context
Follow-up to #1505 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions