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

Add ng-anotate support

Open bodia-uz opened this issue 9 years ago • 2 comments

Could You please, add suport of ng-annotate di syntax?

I mean comments like /* @ngInject */.

bodia-uz avatar Dec 17 '16 16:12 bodia-uz

The rules should check this : 1)

var app = angular.module('hello');
app.factory(function(toto, titi) {'ngInject';});

But with ng-annotate implicit annotation, it becomes useless.

var app = angular.module('hello');
app.factory(factoryFn);
var factoryFn= function(toto, titi) {'ngInject';}

But with ng-annotate implicit annotation (managing reference), it becomes also useless.

import { factoryFn} from './hello.factory.js';
angular.module('hello').factory(factoryFn);

and in the ./hello.factory.js file export const factoryFn = function(toto, titi) {'ngInject';}

This last one would be interesting to have but I am not sure that eslint does like tslint, ie linting accross files.

Meanwhile, using ng-strict-di is the best way to verify that there is no DI error. And it is also the recommanded one.

For my point of view, this ng-annotate eslint rule should be abandonned.

jlguenego avatar Aug 31 '17 17:08 jlguenego

I don't think this has everything to do with di-error, is about DRY, why would you keep in sync two sets of the same names?, if there is a tool that can do it for you 😎

jesujcastillom avatar Sep 15 '17 23:09 jesujcastillom