forked from EmmanuelDemey/eslint-plugin-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
component-limit.js
36 lines (32 loc) · 1.02 KB
/
component-limit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// example - valid: true
angular.module('myModule').controller('SomeController', function() {
// ...
});
// example - valid: true
angular.module('myModule').directive('myDirective', function() {
// ...
});
// example - valid: false, errorMessage: "There may be at most 1 AngularJS component per file, but found 2"
angular.module('myModule').controller('ControllerOne', function() {
// ...
}).directive('directiveTwo', function() {
// ...
});
// example - valid: true, options: [3]
angular.module('myModule').controller('ControllerOne', function() {
// ...
}).directive('directiveTwo', function() {
// ...
}).factory('serviceThree', function() {
// ...
});
// example - valid: false, options: [3], errorMessage: "There may be at most 3 AngularJS components per file, but found 4"
angular.module('myModule').controller('ControllerOne', function() {
// ...
}).directive('directiveTwo', function() {
// ...
}).factory('serviceThree', function() {
// ...
}).filter('filterFour', function() {
// ...
});