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

Refactor TypeScript definition to use CJS compatible export #32

Merged
merged 8 commits into from Mar 31, 2019
Merged

Refactor TypeScript definition to use CJS compatible export #32

merged 8 commits into from Mar 31, 2019

Conversation

BendingBender
Copy link
Contributor

@BendingBender BendingBender commented Mar 25, 2019

Fixes #31.

Waiting for tsdjs/tsd#20.

@BendingBender BendingBender marked this pull request as ready for review March 29, 2019 07:23
Copy link
Collaborator

@fregante fregante left a comment

Choose a reason for hiding this comment

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

I tried all of these combinations and all seem to be working correctly (approved by TS or showing autocomplete in VSCode.

// TS file
import mem from 'mem';
import mem = require('mem');

// JS file
import mem from 'mem';
const mem = require('mem')

So I approve this style, except the two comments below:

index.test-d.ts Show resolved Hide resolved
index.d.ts Show resolved Hide resolved
Copy link
Collaborator

@fregante fregante left a comment

Choose a reason for hiding this comment

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

Your reasoning makes sense, and also the intent to drop the default export in future releases to avoid breaking existing setups without esModuleInterop 👍

@BendingBender
Copy link
Contributor Author

BendingBender commented Mar 29, 2019

#29 probably should be merged before this one.

@sindresorhus
Copy link
Owner

#29 probably should be merged before this one.

index.d.ts Outdated Show resolved Hide resolved
index.test-d.ts Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

Can you add a TODO comment to https://github.com/sindresorhus/mem/blob/master/index.js#L79 too?

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.

None yet

3 participants