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

Commit 0f78baf

Browse files
committed
Preset: Add "requireSpacesInsideParentheses" to jquery preset
Closes gh-997
1 parent 8ddbd46 commit 0f78baf

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

presets/jquery.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"requireSpacesInFunctionExpression": {
3333
"beforeOpeningCurlyBrace": true
3434
},
35+
"requireSpacesInsideParentheses": "all",
3536
"requireSpaceAfterKeywords": [
3637
"if",
3738
"else",

test/data/options/preset/jquery.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,29 @@ jQuery.extend = jQuery.fn.extend = function() {
5050
if ( typeof target === "boolean" ) {
5151
// requireSpacesInAnonymousFunctionExpression: before curly
5252
// disallowSpacesInAnonymousFunctionExpression: before opening round brace
53-
$("#foo").click(function() {
54-
});
53+
$( "#foo" ).click( function() {
54+
} );
5555
}
5656

5757
// disallowMultipleLineBreaks
5858
// Handle case when target is a string or something (possible in deep copy)
59-
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
59+
if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
6060
// Modified for requireCurlyBraces
6161
try {
6262
// requireSpacesInsideObjectBrackets
6363
target = { foo: "bar" };
64-
} catch (e) {
64+
} catch ( e ) {
6565
throw e;
6666
}
6767
}
6868

6969
// requireParenthesesAroundIIFE
70-
(function() {
70+
( function() {
7171

72-
})();
72+
} )();
7373

7474
// Only deal with non-null/undefined values
75-
if ( (options = arguments[ i ]) != null ) {
75+
if ( ( options = arguments[ i ] ) != null ) {
7676
// Extend the base object
7777
for ( name in options ) {
7878
// Prevent never-ending loop
@@ -85,8 +85,8 @@ jQuery.extend = jQuery.fn.extend = function() {
8585
}
8686

8787
// requireOperatorBeforeLineBreak
88-
if ( deep && copy && ( jQuery.isPlainObject(copy) ||
89-
(copyIsArray = jQuery.isArray(copy)) ) ) {
88+
if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
89+
( copyIsArray = jQuery.isArray( copy ) ) ) ) {
9090

9191
// Don't bring in undefined values
9292
} else if ( copy !== undefined ) {

0 commit comments

Comments
 (0)