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
Drop non-working default
export for TypeScript users
#89
Conversation
I'm not entirely sure of how to fool import/default without having an actual See eslint's log at https://travis-ci.org/sindresorhus/is/jobs/533220117 |
I would prefer just reverting back to: export default is;
// For CommonJS default export support
module.exports = is;
module.exports.default = is; Which we know are working. |
|
Not exactly, since the source here is TypeScript, while sindresorhus/memoize#31 is about CommonJS. |
The previous change broke compatibility (sadly, but we’re still v0.x) but given the TODO comment in that PR, I think your modules aren’t meant to export
|
default
export
default
exportdefault
export for TypeScript users
You have to update the test to use |
test/test.ts
Outdated
@@ -7,11 +7,15 @@ import test, {ExecutionContext} from 'ava'; | |||
import {JSDOM} from 'jsdom'; | |||
import {Subject, Observable} from 'rxjs'; | |||
import ZenObservable from 'zen-observable'; | |||
import is, {TypeName} from '../source'; | |||
|
|||
// eslint-disable-next-line @typescript-eslint/no-require-imports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either import/default
follows esModuleInterop
and therefore allows import X from Y
on CJS modules, or @typescript-eslint/no-require-imports
should be disabled.
Since I have to disable a rule, I might as well leave the old ESM import and disable import/default
on that line
The last two commits are valid but there's an unrelated TS issue:
|
Fixing this properly requires too many breaking changes. We'll also have to put every type export behind a namespace. I'm just gonna revert the original commit and keep it like this until we can move to ESM later this year. |
Fixes #88
I kept the TODO like in https://github.com/sindresorhus/mem/blob/10f13c0904e497a35bb4cba907490aad1ba6d879/index.d.ts#L93