Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 8b92161

Browse files
hzoopetebacondarwin
authored andcommitted
style(*): add disallowTrailingComma rule for objects and arrays
Closes #9685
1 parent e4ce0dd commit 8b92161

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

.jscs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"disallowSpaceAfterObjectKeys": true,
77
"disallowSpaceAfterPrefixUnaryOperators": ["!"],
88
"disallowSpaceBeforeBinaryOperators": [","],
9+
"disallowTrailingComma": true,
910
"disallowTrailingWhitespace": true,
1011
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"]
1112
}

test/auto/injectorSpec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ describe('strict-di injector', function() {
960960
it('should throw if magic annotation is used by provider', function() {
961961
module(function($provide) {
962962
$provide.provider({
963-
'$test': function() { this.$get = function($rootScope) { return $rootScope; }; },
963+
'$test': function() { this.$get = function($rootScope) { return $rootScope; }; }
964964
});
965965
});
966966
inject(function($injector) {
@@ -974,7 +974,7 @@ describe('strict-di injector', function() {
974974
it('should throw if magic annotation is used by factory', function() {
975975
module(function($provide) {
976976
$provide.factory({
977-
'$test': function($rootScope) { return function() {}; },
977+
'$test': function($rootScope) { return function() {}; }
978978
});
979979
});
980980
inject(function($injector) {

test/loaderSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('module loader', function() {
5252
['$provide', 'value', ['k', 'v'] ],
5353
['$filterProvider', 'register', ['f', 'ff'] ],
5454
['$compileProvider', 'directive', ['d', 'dd'] ],
55-
['$controllerProvider', 'register', ['ctrl', 'ccc']],
55+
['$controllerProvider', 'register', ['ctrl', 'ccc']]
5656
]);
5757
expect(myModule._configBlocks).toEqual([
5858
['$injector', 'invoke', ['config'] ],

test/ng/browserSpecs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function MockWindow(options) {
5454
replace: function(url) {
5555
locationHref = url;
5656
mockWindow.history.state = null;
57-
},
57+
}
5858
};
5959

6060
this.history = {
@@ -81,7 +81,7 @@ function MockWindow(options) {
8181
ieState = value;
8282
},
8383
configurable: true,
84-
enumerable: true,
84+
enumerable: true
8585
});
8686
}
8787
}

test/ng/compileSpec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ describe('$compile', function() {
295295
directive('svgCircleUrl', valueFn({
296296
replace: true,
297297
templateUrl: 'template.html',
298-
templateNamespace: 'SVG',
298+
templateNamespace: 'SVG'
299299
}));
300300
});
301301
inject(function($compile, $rootScope, $httpBackend) {
@@ -1058,7 +1058,7 @@ describe('$compile', function() {
10581058
template: '<msup><mn>{{pow}}</mn></msup>',
10591059
templateNamespace: 'MATH',
10601060
scope: {
1061-
pow: '@pow',
1061+
pow: '@pow'
10621062
},
10631063
link: function(scope, elm, attr, ctrl, transclude) {
10641064
transclude(function(node) {
@@ -1972,7 +1972,7 @@ describe('$compile', function() {
19721972
templateUrl: 'template.html',
19731973
templateNamespace: 'math',
19741974
scope: {
1975-
pow: '@pow',
1975+
pow: '@pow'
19761976
},
19771977
link: function(scope, elm, attr, ctrl, transclude) {
19781978
transclude(function(node) {
@@ -3185,7 +3185,7 @@ describe('$compile', function() {
31853185
'toString': '&',
31863186

31873187
// Spidermonkey extension, may be obsolete in the future
3188-
'watch': '=',
3188+
'watch': '='
31893189
}
31903190
}));
31913191
});

test/ng/directive/selectSpec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,7 @@ describe('select', function() {
19881988
createSelect({
19891989
'name': 'select',
19901990
'ng-model': 'value',
1991-
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']',
1991+
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']'
19921992
});
19931993

19941994
scope.form.select.$parsers.push(function(value) {
@@ -2005,7 +2005,7 @@ describe('select', function() {
20052005
createSelect({
20062006
'name': 'select',
20072007
'ng-model': 'value',
2008-
'ng-options': 'item for item in [\'the first\', \'the second\', \'the third\', \'the fourth\']',
2008+
'ng-options': 'item for item in [\'the first\', \'the second\', \'the third\', \'the fourth\']'
20092009
});
20102010

20112011
scope.form.select.$formatters.push(function(value) {
@@ -2022,7 +2022,7 @@ describe('select', function() {
20222022
createSelect({
20232023
'name': 'select',
20242024
'ng-model': 'value',
2025-
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']',
2025+
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']'
20262026
});
20272027

20282028
scope.form.select.$validators.fail = function() {
@@ -2040,7 +2040,7 @@ describe('select', function() {
20402040
createSelect({
20412041
'name': 'select',
20422042
'ng-model': 'value',
2043-
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']',
2043+
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']'
20442044
});
20452045

20462046
scope.form.select.$validators.pass = function() {
@@ -2059,7 +2059,7 @@ describe('select', function() {
20592059
createSelect({
20602060
'name': 'select',
20612061
'ng-model': 'value',
2062-
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']',
2062+
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']'
20632063
});
20642064

20652065
scope.form.select.$asyncValidators.async = function() {
@@ -2085,7 +2085,7 @@ describe('select', function() {
20852085
createSelect({
20862086
'name': 'select',
20872087
'ng-model': 'value',
2088-
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']',
2088+
'ng-options': 'item for item in [\'first\', \'second\', \'third\', \'fourth\']'
20892089
});
20902090

20912091
scope.form.select.$asyncValidators.async = function() {

test/ng/rafSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('$$rAF', function() {
3939
var injector = createInjector(['ng', function($provide) {
4040
$provide.value('$timeout', timeoutSpy);
4141
$provide.value('$window', {
42-
location: window.location,
42+
location: window.location
4343
});
4444
}]);
4545

test/ngMessages/messagesSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ describe('ngMessages', function() {
361361
$rootScope.$apply(function() {
362362
$rootScope.data = {
363363
'a': 1,
364-
'b': 2,
364+
'b': 2
365365
};
366366
});
367367

0 commit comments

Comments
 (0)