eslint-plugin-angular icon indicating copy to clipboard operation
eslint-plugin-angular copied to clipboard

`no-run-logic`: allow assignment

Open jrencz opened this issue 9 years ago • 2 comments

The following (apparently a valid configuration according to Angular documentation on $http caching) is not valid with no-run-logic enabled

.run(function (
  $http,
  someCacheService
) {
  $http.defaults.cache = someCacheService;
})

It should be allowed to assign (maybe optionally?)

jrencz avatar Aug 02 '16 11:08 jrencz

Good point. I also think the rule no-run-logic is not exactly what the referenced rule by johnpapa says (https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y171).

tilmanschweitzer avatar Aug 03 '16 21:08 tilmanschweitzer

You should write a service to configure your cache.

The AngularJS documentation is full of bad practices.

MarcLoupias avatar Aug 30 '17 13:08 MarcLoupias