fkhadra / react-toastify

React notification made easy 🚀 !
https://fkhadra.github.io/react-toastify/introduction
MIT License
12.34k stars 676 forks source link

Move `types` condition to the front of the `addons/use-notification-center` entry #949

Closed Andarist closed 1 year ago

Andarist commented 1 year ago

I moved types condition to the front. package.json#exports are order-sensitive - they are always matched from the top to the bottom. When a match is found then it should be used and no further matching should occur.

Right now, the current setup works in TypeScript but it's considered a bug and it should not be relied upon, see the thread and the comment here. For that reason, I would like to fix all popular packages that misconfigured their exports this way so the bug can be fixed in TypeScript.

This matches how types were already configured for the rest of your entrypoints, this one was the single outlier

coveralls commented 1 year ago

Coverage Status

Coverage: 88.864%. Remained the same when pulling b30ba4d54d9416afea22d381ae0f8a9fd77f2a95 on Andarist:fix/types-condition into 97d9afc48c6e2ef0f6240842700251b8b6e64cd9 on fkhadra:main.