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

feat: warn on likely failed d.ts file generation #2428

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

dummdidumm
Copy link
Member

emitDts now warns when it detects diagnostics that likely mean the d.ts file was not generated

emitDts now warns when it detects diagnostics that likely mean the `d.ts` file was not generated
@dummdidumm dummdidumm merged commit 8d3a335 into master Jul 2, 2024
3 checks passed
@dummdidumm dummdidumm deleted the emit-dts-warning branch July 2, 2024 14:31
@jasonlyu123
Copy link
Member

The code for #2371 is 2742 but judging from https://github.com/microsoft/TypeScript/blob/main/src/compiler/transformers/declarations.ts there are 10+ more exceptions outside the 4000-4108 range. Do you think we should write a script to fetch it from this file or maybe try something like #2371 (comment)?

@dummdidumm
Copy link
Member Author

Sounds good - let's try that! As for the diagnostic: TBH even for me, and even if the code wasn't transpiled, it's super confusing to really know what I should do after getting such an error message. So I wouldn't invest too much time into making them nicer.

@SystemParadox
Copy link

I literally ran into this last week and this patch would have saved a lot of time! I agree that just knowing that it failed (and which file) is the main thing. I think it's highly like that in practice you'll have to open it up in vscode to be able to work out what's going on anyway.

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

Successfully merging this pull request may close these issues.

3 participants