You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Use accurate export style in TypeScript types
The current way is inaccurate because `index.js`, the `main`
entrypoint, uses CommonJS and does not export `default`. Thus it works
only when the library consumer enables `esModuleInterop`. Most devs have
it enabled, but this option is just a workaround for badly written
type declarations.
https://github.com/DefinitelyTyped/DefinitelyTyped#a-package-uses-export--but-i-prefer-to-use-default-imports-can-i-change-export--to-export-default:
> For an npm package, export = is accurate if `node -p 'require("foo")'`
> works to import a module, and export default is accurate if
> `node -p 'require("foo").default'` works to import a module.
0 commit comments