Skip to content

Check for unused injected values #159

@remcohaszing

Description

@remcohaszing

If injected values are unused, this is mostly a result of forgetting to remove them.

The following should trigger a warning:

factory('example', function(dependency) {})

The following should not trigger a warning:

factory('example', function(dependency) {
  return dependency;
})

factory('example', function(dependency) {
  dependency();
})

factory('example', function(dependency) {
  function nested() {dependency();}
})

The rule should apply to all places where dependencies may be injected:

  • factories
  • services
  • controllers
  • directives
  • decorators
  • run
  • config
  • providers
  • providers $get function.
  • functions annotated with /*@ngInject*/

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions