Expose the typescript diagnostic object to error formatter functions#996
Expose the typescript diagnostic object to error formatter functions#996srgpqt wants to merge 3 commits intoTypeStrong:masterfrom
Conversation
|
This looks interesting! Could you write an execution test for this please? You can likely clone this one: https://github.com/TypeStrong/ts-loader/tree/master/test/comparison-tests/errorFormatter There's some instructions here: https://github.com/TypeStrong/ts-loader/blob/master/test/comparison-tests/README.md We only need expected output for the latest version of TypeScript 3.6 |
|
@johnnyreilly here you go :) |
|
Nice work! I can completely see that people might value this. Would you like to update the Also could you update the It's probably worth blogging about this new feature BTW, do you write a blog? |
|
@johnnyreilly , I've given this some more thought, and now I believe everyone would prefer to have the improved error formatter ( |
|
I'm not sure.... The thing that makes me slightly cautious about that is that this API isn't always available and it could change. If it changes it might break ts-loader consumers on different versions of TypeScript. So the current approach seems safer. And if it's well documented then it's easy for others to implement. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
@srgpqt - are you still contributing to this? |
|
Feel free to pick up where I left off! This PR was ready to merge already, as far as I can tell. |
|
I think it was just a matter of updating I can do it if you're not interested, but I also don't want to steal your credits by making a new PR. |
|
I feel like package.json should be updated when preparing a new release, but I suppose I could do it anyway. It just feels wrong to do that when it’s uncertain when the next release to npm would be... |
|
@johnnyreilly - any directions here? |
|
Could you catch up this branch with
Could the docs include an example of how to use Thanks! |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Closing as stale. Please reopen if you'd like to work on this further. |
This makes it easy to use TypeScript's builtin error formatters. Of particular interest is TypeScript's
formatDiagnosticsWithColorAndContextfunction that produces much better error output.A custom formatter could be defined as: