EmmanuelDemey / EmmanuelDemey/eslint-plugin-angular

di, di-order and di-unused don't work with modules in variables

Open
#389 1 comment 1 reaction 1 assignee Claimed by @EmmanuelDemey View on GitHub
Bug Rule
Dominant language
JavaScript
Stars
620
Forks
127
PR merge metrics
No merged PRs in 30d

Description

The following syntax produces errors as expected:

```
angular.module('MyModule').controller('MyCtrl', function(Zulu, Alpha, Bravo) {
Bravo.something();
});
```

Throws
- di: use array syntax
- di-order: injected dependecies should be in alphabetical order
- di-unused: Zulu and Alpha unused

But the following code passes fine:

```
(function(ngModule) {
ngModule.controller('MyCtrl', function(Zulu, Alpha, Bravo) {
Bravo.something();
});
})(angular.module('MyModule'));
```

I would expect both pieces of code to throw the same error.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.