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

style: disallow space after object keys, other rules #9679

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jscs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"disallowKeywords": ["with"],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowTrailingWhitespace": true,
"disallowSpaceAfterPrefixUnaryOperators": ["!"],
"disallowSpaceBeforeBinaryOperators": [","],
"disallowSpaceAfterObjectKeys": true,
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"]
}
2 changes: 1 addition & 1 deletion src/AngularPublic.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function publishExternalAPI(angular){
$timeout: $TimeoutProvider,
$window: $WindowProvider,
$$rAF: $$RAFProvider,
$$asyncCallback : $$AsyncCallbackProvider
$$asyncCallback: $$AsyncCallbackProvider
});
}
]);
Expand Down
12 changes: 6 additions & 6 deletions src/jqLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function jqNextId() { return ++jqId; }

var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
var MOUSE_EVENT_MAP= { mouseleave : "mouseout", mouseenter : "mouseover"};
var MOUSE_EVENT_MAP= { mouseleave: "mouseout", mouseenter: "mouseover"};
var jqLiteMinErr = minErr('jqLite');

/**
Expand Down Expand Up @@ -521,11 +521,11 @@ forEach('input,select,option,textarea,button,form,details'.split(','), function(
BOOLEAN_ELEMENTS[value] = true;
});
var ALIASED_ATTR = {
'ngMinlength' : 'minlength',
'ngMaxlength' : 'maxlength',
'ngMin' : 'min',
'ngMax' : 'max',
'ngPattern' : 'pattern'
'ngMinlength': 'minlength',
'ngMaxlength': 'maxlength',
'ngMin': 'min',
'ngMax': 'max',
'ngPattern': 'pattern'
};

function getBooleanAttrName(element, name) {
Expand Down
26 changes: 13 additions & 13 deletions src/ng/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ var $AnimateProvider = ['$provide', function($provide) {
* page}.
*/
return {
animate : function(element, from, to) {
animate: function(element, from, to) {
applyStyles(element, { from: from, to: to });
return asyncPromise();
},
Expand All @@ -191,7 +191,7 @@ var $AnimateProvider = ['$provide', function($provide) {
* @param {object=} options an optional collection of styles that will be applied to the element.
* @return {Promise} the animation callback promise
*/
enter : function(element, parent, after, options) {
enter: function(element, parent, after, options) {
applyStyles(element, options);
after ? after.after(element)
: parent.prepend(element);
Expand All @@ -209,7 +209,7 @@ var $AnimateProvider = ['$provide', function($provide) {
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
leave : function(element, options) {
leave: function(element, options) {
element.remove();
return asyncPromise();
},
Expand All @@ -232,7 +232,7 @@ var $AnimateProvider = ['$provide', function($provide) {
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
move : function(element, parent, after, options) {
move: function(element, parent, after, options) {
// Do not remove element before insert. Removing will cause data associated with the
// element to be dropped. Insert will implicitly do the remove.
return this.enter(element, parent, after, options);
Expand All @@ -251,11 +251,11 @@ var $AnimateProvider = ['$provide', function($provide) {
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
addClass : function(element, className, options) {
addClass: function(element, className, options) {
return this.setClass(element, className, [], options);
},

$$addClassImmediately : function(element, className, options) {
$$addClassImmediately: function(element, className, options) {
element = jqLite(element);
className = !isString(className)
? (isArray(className) ? className.join(' ') : '')
Expand All @@ -280,11 +280,11 @@ var $AnimateProvider = ['$provide', function($provide) {
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
removeClass : function(element, className, options) {
removeClass: function(element, className, options) {
return this.setClass(element, [], className, options);
},

$$removeClassImmediately : function(element, className, options) {
$$removeClassImmediately: function(element, className, options) {
element = jqLite(element);
className = !isString(className)
? (isArray(className) ? className.join(' ') : '')
Expand All @@ -310,7 +310,7 @@ var $AnimateProvider = ['$provide', function($provide) {
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
setClass : function(element, add, remove, options) {
setClass: function(element, add, remove, options) {
var self = this;
var STORAGE_KEY = '$$animateClasses';
var createdCache = false;
Expand All @@ -320,7 +320,7 @@ var $AnimateProvider = ['$provide', function($provide) {
if (!cache) {
cache = {
classes: {},
options : options
options: options
};
createdCache = true;
} else if (options && cache.options) {
Expand Down Expand Up @@ -357,15 +357,15 @@ var $AnimateProvider = ['$provide', function($provide) {
return cache.promise;
},

$$setClassImmediately : function(element, add, remove, options) {
$$setClassImmediately: function(element, add, remove, options) {
add && this.$$addClassImmediately(element, add);
remove && this.$$removeClassImmediately(element, remove);
applyStyles(element, options);
return asyncPromise();
},

enabled : noop,
cancel : noop
enabled: noop,
cancel: noop
};
}];
}];
6 changes: 3 additions & 3 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
*
* @param {string} classVal The className value that will be added to the element
*/
$addClass : function(classVal) {
$addClass: function(classVal) {
if (classVal && classVal.length > 0) {
$animate.addClass(this.$$element, classVal);
}
Expand All @@ -915,7 +915,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
*
* @param {string} classVal The className value that will be removed from the element
*/
$removeClass : function(classVal) {
$removeClass: function(classVal) {
if (classVal && classVal.length > 0) {
$animate.removeClass(this.$$element, classVal);
}
Expand All @@ -933,7 +933,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
* @param {string} newClasses The current CSS className value
* @param {string} oldClasses The former CSS className value
*/
$updateClass : function(newClasses, oldClasses) {
$updateClass: function(newClasses, oldClasses) {
var toAdd = tokenDifference(newClasses, oldClasses);
if (toAdd && toAdd.length) {
$animate.addClass(this.$$element, toAdd);
Expand Down
4 changes: 2 additions & 2 deletions src/ng/directive/ngShowHide.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ var ngShowDirective = ['$animate', function($animate) {
// to have a global/greedy CSS selector that breaks when other animations are run.
// Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845
$animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {
tempClasses : NG_HIDE_IN_PROGRESS_CLASS
tempClasses: NG_HIDE_IN_PROGRESS_CLASS
});
});
}
Expand Down Expand Up @@ -327,7 +327,7 @@ var ngHideDirective = ['$animate', function($animate) {
// The comment inside of the ngShowDirective explains why we add and
// remove a temporary class for the show/hide animation
$animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, {
tempClasses : NG_HIDE_IN_PROGRESS_CLASS
tempClasses: NG_HIDE_IN_PROGRESS_CLASS
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/ng/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ function $HttpProvider() {
status: status,
headers: headersGetter(headers),
config: config,
statusText : statusText
statusText: statusText
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/ng/rootScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ function $RootScopeProvider(){
asyncQueue.push({scope: this, expression: expr});
},

$$postDigest : function(fn) {
$$postDigest: function(fn) {
postDigestQueue.push(fn);
},

Expand Down
4 changes: 2 additions & 2 deletions src/ng/sniffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ function $SnifferProvider() {
},
csp: csp(),
vendorPrefix: vendorPrefix,
transitions : transitions,
animations : animations,
transitions: transitions,
animations: animations,
android: android
};
}];
Expand Down
Loading