[@types/alpinejs] Add named exports #69404
Replies: 3 comments 2 replies
-
Thanks for the discussion about "alpinejs", some useful links for everyone: |
Beta Was this translation helpful? Give feedback.
-
Hmm 🤔 Strange that I missed that. It's challenging trying to make types packages for projects with no types |
Beta Was this translation helpful? Give feedback.
-
@anantakrishna So this is not an issue with the types...per se. Alpine's source code does not do a named export of any kind. It only has a default export. However, the current build system, for some reason, adds Alpine as a named export to the distributed script. I believe it would be unwise to incorporate a named export into the types, as the source does not actually provide any guarantee of that being included in the future. I'd advise you to also not use the named export for the same reason as above. Such a change would be unlikely to be marked as a breaking change, and is more an unintended side effect. |
Beta Was this translation helpful? Give feedback.
-
Alpine has got named exports in alpinejs/alpine#3644 (https://github.com/alpinejs/alpine/releases/tag/v3.13.4). I believe this has not been reflected in the types.
When I do
I get this eslint error: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default.md.
Changing to
gives me the following TS error:
Testing on
alpinejs
v3.13.7@types/alpinejs
v3.13.10Beta Was this translation helpful? Give feedback.
All reactions