简体   繁体   English

在 WebStorm 中显示 codelyzer 错误

[英]Show codelyzer errors in WebStorm

In my Angular 9 app, I've set up some codelyzer rules in order to benefit of accessibility checks such as template-accessibility-label-for , by adding them to my tslint.json file.在我的Angular 9应用程序中,我已经设置了一些codelyzer规则,以便通过将它们添加到我的tslint.json文件中来受益于可访问性检查,例如template-accessibility-label-for

The rules correctly work when using ng lint , which will correctly catch any errors.使用ng lint ,规则可以正常工作,这将正确捕获任何错误。

However, I don't get any errors in my WebStorm IDE , which is strange since I normally get TSLint warnings there too.但是,我的WebStorm IDE 中没有任何错误,这很奇怪,因为我通常也会在那里收到 TSLint 警告。

How can I enable the codelyzer warnings in WebStorm?如何在 WebStorm 中启用 codelyzer 警告?

TSLint integration doesn't currently support linting HTML files; TSLint 集成目前不支持 linting HTML 文件; please vote for WEB-27479 to be notified on any updates.请投票给WEB-27479 ,以便在任何更新时收到通知。

Work is in progress, but there are some issues:工作正在进行中,但存在一些问题:

  • error offsets are slightly wrong ( https://github.com/mgechev/codelyzer/issues/859 )错误偏移量略有错误( https://github.com/mgechev/codelyzer/issues/859
  • it's not possible to pass html template file content via the TSLint API, so we'll have to auto-save the file instead to pass the code to linter.不可能通过 TSLint API 传递 html 模板文件内容,因此我们必须自动保存文件而不是将代码传递给 linter。 This will have side effects like reloading app in browser on every change because of Angular cli hot reloading that works on file saving这将产生副作用,例如在每次更改时在浏览器中重新加载应用程序,因为 Angular cli 热重新加载适用于文件保存

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

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