简体   繁体   中英

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.

The rules correctly work when using ng lint , which will correctly catch any errors.

However, I don't get any errors in my WebStorm IDE , which is strange since I normally get TSLint warnings there too.

How can I enable the codelyzer warnings in WebStorm?

TSLint integration doesn't currently support linting HTML files; please vote for WEB-27479 to be notified on any updates.

Work is in progress, but there are some issues:

  • error offsets are slightly wrong ( 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. This will have side effects like reloading app in browser on every change because of Angular cli hot reloading that works on file saving

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