Skip to content

support typescript#170

Closed
zy445566 wants to merge 1 commit intoLevel:masterfrom
zy445566:patch-1
Closed

support typescript#170
zy445566 wants to merge 1 commit intoLevel:masterfrom
zy445566:patch-1

Conversation

@zy445566
Copy link

No description provided.

@vweevers
Copy link
Member

We have this default export in a bunch of other modules, but surely typescript users have used level at this point so I'm wondering when/why this is needed? And why can't TS fix this on their end?

cc @MeirionHughes

@MeirionHughes
Copy link
Member

MeirionHughes commented Dec 24, 2019

I'm inclined to suggest we remove the default export from everything, as at the moment its quite inconsistent (there are more modules that don't use 'default' that do - especially in the wider eco-system):

import levelup from 'levelup';
import * as subleveldown from 'subleveldown;

you don't need 'default' to use it, and the level modules are not esm - they're cjs. Could potentially do this ('hide' the default export) without a major semver, here, but it probably would require a major semver on definitely typed (which might be problematic as they're trying to keep the versions synced these days).

you can actually use the --allowSyntheticDefaultImports option on typescript anyway and it will allow you to do a default import on modules that don't have one.

@zy445566 zy445566 closed this Dec 26, 2019
@zy445566 zy445566 deleted the patch-1 branch December 26, 2019 03:12
@vweevers vweevers mentioned this pull request Dec 26, 2019
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants