简体   繁体   中英

How to save typescript compiler errors in json file?

I want to save errors in json file format so I can parse those errors in language of my choice (ruby/python) to refactor my code.

I tried --pretty option but it did not gave output in json format

There is no official compiler option to format the errors in JSON format. Here is the Output Formatting Reference .

To export your errors into a file, you can use the > -Syntax:

tsc .\src\main.ts --pretty > errors.json

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM