Skip to content

Filter diagnostics #99

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

Closed
Exeteres opened this issue Jul 2, 2020 · 4 comments
Closed

Filter diagnostics #99

Exeteres opened this issue Jul 2, 2020 · 4 comments

Comments

@Exeteres
Copy link

Exeteres commented Jul 2, 2020

I need to filter diagnostic messages after code emit.
I managed to filter them in VSCode using language service plugin and now I am trying to suppress this errors in ttsc output.
Firstly, I tried to patch the emit method of program provided to the transformer factory, but it does not work.
I also can't patch any function like emitFilesAndReportErrorsAndGetExitStatus, possibly because ttypescript passes to tsc another ts instance.
Any thoughts?

@nonara
Copy link
Contributor

nonara commented Jul 2, 2020

ttypescript isn't built with that functionality. You can accomplish that with ts-patch, however.

@Exeteres
Copy link
Author

Exeteres commented Jul 3, 2020

@nonara I know about ts-patch. I was using it's program replace feature. And I also know about the ability to alter diagnostics.
I will use ts-patch as a workaround, but I see no problems to implement this functionality in ttypescript.
Honestly, I think that ttypescript way of patching typescript on the fly is much cleaner than patching typescript on the filesystem.
But if for some reason this feature cannot be implemented in ttypescript, I will replace ttypescript with ts-patch in the existing code bases.

@nonara
Copy link
Contributor

nonara commented Jul 3, 2020

The logic is compatible, but I'm not a maintainer, so I cant speak to whether a PR for that feature would be accepted.

For what you're looking to do, you'd probably need to fork and migrate the logic or just use ts-patch. Good luck with it!

@cevek
Copy link
Owner

cevek commented Sep 7, 2020

Sorry, but filtering diagnostics is not goal for this project. Use native typescript plugin system instead.

@cevek cevek closed this as completed Sep 7, 2020
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

3 participants