Skip to content
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

Fix malformed typescript exports #11

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

programminghoch10
Copy link
Contributor

When using your module as a ES module like this

import telegramifyMarkdown from 'telegramify-markdown'

the following compile error occurs:

node_modules/telegramify-markdown/types/index.d.ts(12,3): 
error TS2666: 
Exports and export assignments are not permitted in module augmentations.

The issue is explained here
and it basically says you can't use export = and export together in one module
because it mixes up commonjs module and ES module syntax.

I found the simple fix is removing the export on UnsupportedTagsStrategy,
because the module will simply continue to work as is.
The autocompletion on the second parameter of convert also continues to work.

While at it you can add to your README somewhere that

import telegramifyMarkdown from 'telegramify-markdown'

is the ES module compatible import.

@skoropadas
Copy link
Owner

Thanks a lot for the PR!

@skoropadas skoropadas self-requested a review August 2, 2024 08:02
@skoropadas skoropadas merged commit 1f8b1bd into skoropadas:master Aug 2, 2024
2 checks passed
Copy link

github-actions bot commented Aug 2, 2024

🎉 This PR is included in version 1.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants