Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support typescript #170

Closed
wants to merge 1 commit into from
Closed

support typescript #170

wants to merge 1 commit into from

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