Show codelyzer errors in WebStorm

341 Views Asked by At

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?

1

There are 1 best solutions below

0
On

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