Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (22 sloc) 1.14 KB

empty-controller - disallow empty controllers

If you have one empty controller, maybe you have linked it in your Router configuration or in one of your views. You can remove this declaration because this controller is useless

Rule based on Angular 1.x


The following patterns are considered problems;

/*eslint angular/empty-controller: 2*/

// invalid
angular.module('myModule').controller('EmptyController', function () {
}); // error: The EmptyController controller is useless because empty. You can remove it from your Router configuration or in one of your view

The following patterns are not considered problems;

/*eslint angular/empty-controller: 2*/

// valid
angular.module('myModule').controller('MyController', function ($log) {
    $log.log('Hello World!');


This rule was introduced in eslint-plugin-angular 0.1.0


You can’t perform that action at this time.