简体   繁体   English

如何在 json 文件中保存 typescript 编译器错误?

[英]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.我想以 json 文件格式保存错误,这样我就可以用我选择的语言(ruby/python)解析这些错误以重构我的代码。

I tried --pretty option but it did not gave output in json format我尝试了 --pretty 选项,但它没有以 json 格式提供 output

There is no official compiler option to format the errors in JSON format.没有官方编译器选项可以将错误格式化为JSON格式。 Here is the Output Formatting Reference .这是Output 格式参考

To export your errors into a file, you can use the > -Syntax:要将错误导出到文件中,您可以使用> -语法:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入json文件时打字稿编译器错误 - Typescript compiler error when importing json file 字符串上的TypeScript编译器错误 - TypeScript Compiler Errors on String 将打字稿错误连接到相关的编译器选项 (tsconfig.json) - Connecting typescript errors to their associated compiler options (tsconfig.json) WebStorm中的TypeScript编译器将TSConfig.json作为Typescript文件 - TypeScript compiler in WebStorm see TSConfig.json as a Typescript file TypeScript编译器:将已编译文件与源文件保存在同一目录中 - TypeScript compiler: save compiled file into the same directory as source file Angular 5 Typescript-保存本地JSON文件 - Angular 5 Typescript - Save Local JSON File 如何使用 typscript 编译器在 typescript 文件中向现有 json object 添加另一个属性? - How do I add another property to an existing json object in a typescript file using typscript compiler? 如何阻止 TypeScript 编译器报告符号链接模块中的编译错误 - How to stop TypeScript compiler from reporting compilation errors in symlinked modules 尝试编译TypeScript编译器时出错 - Errors trying to compile TypeScript compiler Typescript编译器将requirejs垫片定义标记为错误。 如何解决? - typescript compiler flags requirejs shim definitions as errors. How to fix it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM