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

Be smarter about callable imports/exports #2

Open
DanielRosenwasser opened this issue Mar 4, 2019 · 0 comments
Open

Be smarter about callable imports/exports #2

DanielRosenwasser opened this issue Mar 4, 2019 · 0 comments

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Mar 4, 2019

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';
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant