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

What to do for missing export = when it's TypeScript's fault (kinda) #129

Closed
benasher44 opened this issue Jan 6, 2024 · 2 comments
Closed

Comments

@benasher44
Copy link
Contributor

benasher44 commented Jan 6, 2024

ajv is an example of a package that uses TypeScript, but the generated .d.ts by TypeScript suffers from the missing export = issue (extra .default is needed when imported with NodeNext).

As a workaround, I'm opening a PR to their library to explicitly export the Ajv class, but I wasn't able to figure out the settings needed to get TypeScript to generate a better .d.ts. It would be great to update the docs to cover that case.

@benasher44 benasher44 changed the title Missing export = when it's TypeScript's fault (kinda) What to do for missing export = when it's TypeScript's fault (kinda) Jan 6, 2024
@benasher44
Copy link
Contributor Author

Actually I see you commented on that issue. I have some follow up questions. I'll follow up on that ticket.

@andrewbranch
Copy link
Collaborator

The source of the issue there, as far as declaration file correctness goes, is that the TS contains some direct module.exports manipulation, which the type system / TS module system doesn’t track.

@andrewbranch andrewbranch closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants