Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ng-anotate support #426

Open
bodia-uz opened this issue Dec 17, 2016 · 2 comments
Open

Add ng-anotate support #426

bodia-uz opened this issue Dec 17, 2016 · 2 comments

Comments

@bodia-uz
Copy link

bodia-uz commented Dec 17, 2016

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

I mean comments like /* @ngInject */.

@jlguenego
Copy link

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.

@jesujcastillom
Copy link

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 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants