num13ru / eslint-plugin-change-detection-strategy

https://www.npmjs.com/package/eslint-plugin-change-detection-strategy
MIT License
9 stars 2 forks source link

Fix does not add import from @angular/core #3

Open kklocker opened 1 year ago

kklocker commented 1 year ago

Hi, wanted to use this plugin in a project, but I am now stuck with plenty of errors `Cannot find name 'ChangeDetectionStrategy'

It would be very nice if the plugin would also check if there exists an import from @angular/core and then add it to the imports.

num13ru commented 1 year ago

Hi! Thanks for your suggestion for improvement. I need some time to explore examples of the logic of correctly adding imports from other similar plugins

num13ru commented 1 year ago

Also created poll https://github.com/num13ru/eslint-plugin-change-detection-strategy/discussions/6

kklocker commented 1 year ago

I am a bit sceptical to the usefulness of this plugin -- I wanted to try it for our app, but after consulting some colleagues, I was made aware that there are places we explicitly don't want OnPush in the component. So in the end i ended up not using it ... You can close this issue for my part

strigefleur commented 1 year ago

It's all about app development strategy - either it's "we don't care so everything is Default" or "we care so everything is OnPush but there are exclusions".

Exclusions could follow classic disable-rule-for-linter-per-file way.

Requesting reopening.

num13ru commented 11 months ago

Good point. I'm going to figure out how to do it without breaking the import list from '@angular/core'; with auto fix