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

Overly aggressive checking for .config function calls, even when inappropriate #413

Closed
jrista opened this issue Aug 24, 2016 · 0 comments
Closed
Assignees
Milestone

Comments

@jrista
Copy link

jrista commented Aug 24, 2016

I am getting angular linting errors in cases when they should not occur. For example, in my current project I am using angular-jwt, which requires some configuration when the app starts. I am getting the following error:

/blah/blah/project/src/client/app/my.module.js
  25:4  error  Avoid using a variable and instead use chaining with the getter syntax  angular/module-getter

Lines starting at 24 contain this:

24 | angular.module(...).config(($httpProvider, $stateProvider, $urlRouterProvider, $locationProvider, jwtInterceptorProvider, jwtOptionsProvider)=> {
25 |    jwtOptionsProvider.config({
26 |        whiteListedDomains: ['auth.ivendix.dev']
27 |    });
28 | ...

The linter is complaining because I've called .config() on jwtOptionsProvider. It is assuming that jwtOptionsProvider is my angular module, however as you can see, that is not the case. The rule here needs to be tightened up to only apply to variables that were actually set to an angular.module call. It cannot apply to all variables, as many providers include a .config() function.

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

2 participants