cevek / ttypescript

Over TypeScript tool to use custom transformers in the tsconfig.json

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filter diagnostics

Exeteres opened this issue · comments

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?

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

@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.

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!

commented

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