arethetypeswrong / arethetypeswrong.github.io

Tool for analyzing TypeScript types of npm packages
https://arethetypeswrong.github.io
MIT License
1.18k stars 41 forks source link

Update MissingExportEquals.md for import default = fetch #130

Closed benasher44 closed 7 months ago

benasher44 commented 9 months ago

It seems that in the case where export default fetch and fetch refers to a namespace and something else being merged with that namespace, one has to add something like this to the namespace:

import _default = fetch;
export { _default as default };

whereas today, the recommendation is:

const _default = typeof fetch;
export { _default as default };

It would be great to update MissingExportEquals.md to cover this namespace edge case.

andrewbranch commented 9 months ago

Let’s see if anything blows up after the @types/node-fetch merge 😄 If nobody complains after a couple days, I agree.

andrewbranch commented 8 months ago

@benasher44 would you want to open a PR?

benasher44 commented 8 months ago

I'm somewhat interested, but I won't have time for the next 4-6 weeks, most likely.