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

module-getter rule false positive #240

Closed
keirlawson opened this issue Oct 19, 2015 · 5 comments
Closed

module-getter rule false positive #240

keirlawson opened this issue Oct 19, 2015 · 5 comments
Assignees

Comments

@keirlawson
Copy link

This rule is getting triggered for the following code:

const MODULE_NAME = 'mymodule';

angular
  .module(MODULE_NAME, [])
  .service('backendService', BackendService);
@EmmanuelDemey
Copy link
Owner

Thanks @keirlawson

Could you send a PR with a failing unit test ? ;)

Manu

@vrockai
Copy link

vrockai commented Nov 5, 2015

There seem to be another false positive for this rule, should I create a new issue for that? It happens when an object has the config method, like:

/** @ngInject */
function lazyLoadDebugConfig($ocLazyLoadProvider) { 
  $ocLazyLoadProvider.config({
    debug: false
  });
}

The ESLint errors than go like this:

  3:1  error  Avoid using a variable and instead use chaining with the getter syntax  angular/module-getter
  3:1  error  You should use the function syntax for DI                               angular/di

@kuhnroyal
Copy link

Same here:

$localForageProvider.config({
    driver: 'localStorageWrapper',
    name: 'test',
    storeName: 'test'
});

@EmmanuelDemey
Copy link
Owner

I solved the first issue. But the last 2, I do not know how we can solve it.
The problem is the config method. We can not detect that your providers is not an angular module easily.

@EmmanuelDemey
Copy link
Owner

I close this issue. See #223

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