Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Be smarter about callable imports/exports #2

@DanielRosenwasser

Description

@DanielRosenwasser

Unfortunately the esModuleInterop flag doesn't have a smaller check which just yells at users when they call/construct an import *.

Maybe this package could do that and provide a good error message?

It isn't legal in ES2015+ to call/construct a namespace import (something declared with the syntax `import * as foo from 'foo'`). Could you please convert your import to use the following syntax?

```ts
import foo = require('foo')
```

Alternatively, you can use a default import like the following with `esModuleInterop` turned on:

```ts
import foo from 'foo';
```

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