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

Add TypeScript definition #81

Merged
merged 2 commits into from
Mar 3, 2019
Merged

Add TypeScript definition #81

merged 2 commits into from
Mar 3, 2019

Conversation

BendingBender
Copy link
Contributor

No description provided.

index.d.ts Outdated
*
* @example
*
* const del = require('del');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use import syntax. This is supposed to be a TS usage example.

Suggested change
* const del = require('del');
* import del from 'del';

@@ -0,0 +1,22 @@
import {expectType} from 'tsd-check';
import del, {sync as delSync} from '.';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I the only one that finds this ugly? Should the sync just be a property of the default export instead of a named export? Or should we name the named export delSync so it doesn't have to be renamed to that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of default imports. They're always kinda ugly, everyone names the thing differently and the tooling has hard times determining what you actually want to import. It's much easier with named exports.

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.

2 participants