Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 12 template linting not working after switchting from tslint to eslint

After upgrading an nx workspace to v12, everything works as before, expected template linted in the IDE.

The IDE (WebStorm) shows some strange errors never happend before: linting erros after upgrading angular

The first warning says No directive is matched on attribute ngIf even the CommonModule is imported, the second error related to the async says Missing require() statement and var async = require('@angular/core/testing').async;

It's really interesting, because building the whole monorepo works flawlessly so I guess this could be caused by some incorrect linting configuration. Have to say that the workspace was not just updated to the newest nx version, It was converted from tslint to eslint as well.

Did someone had similar issues in the past?

like image 472
andreas.teich Avatar asked Jun 08 '21 06:06

andreas.teich


Video Answer


1 Answers

I had the same No directive is matched on attribute ngIf message in PhpStorm, after updating a project to Angular 12. I created a new project with Angular CLI and had the same issue, while another project still on Angular 9 worked fine in the same IDE at the same time.

I did help > check for updates, and it said everything was up to date, but while looking on the JetBrains website I noticed there was a newer version of the Angular Plugin, that was bundled with a newer version of PhpStorm, that the auto update in the IDE had not found; I installed the new PhpStorm and the problem was fixed.

Currently using PhpStorm 2021.1.4

like image 189
CodeMonkey Avatar answered Oct 11 '22 16:10

CodeMonkey