Skip to content
Branch: master
Find file Copy path
Find file Copy path
2 contributors

Users who have contributed to this file

@xdjinnx @j-f1
39 lines (24 sloc) 1 KB

di-unused - disallow unused DI parameters

Unused dependencies should not be injected.

Rule based on Angular 1.x


The following patterns are considered problems;

/*eslint angular/di-unused: 2*/

// invalid
angular.module('myModule').factory('myService', function ($http, $q, $log) {
    $http.get('/api/someData').then(function (response) {
}); // error: Unused injected value $q

The following patterns are not considered problems;

/*eslint angular/di-unused: 2*/

// valid
angular.module('myModule').factory('myService', function ($log, anotherService) {


This rule was introduced in eslint-plugin-angular 0.8.0


You can’t perform that action at this time.