Skip to content

Commit

Permalink
Build: JSCS
Browse files Browse the repository at this point in the history
Includes:
- Whitespace and some style fixings
- Max 100 characters line length partial cleanup
- Ignore test/deepEqual.js
- disable max line length
  - Ref jquery/contribute.jquery.org#80 (comment)
- Wrap immediately invoked function expressions in parentheses

Closes #584
  • Loading branch information
leobalter authored and jzaefferer committed Aug 6, 2014
1 parent 2456eed commit 25e95df
Show file tree
Hide file tree
Showing 10 changed files with 391 additions and 281 deletions.
6 changes: 6 additions & 0 deletions .jscsrc
@@ -0,0 +1,6 @@
{
"preset": "jquery",

// Ref https://github.com/jquery/contribute.jquery.org/issues/80#issuecomment-45253460
"maximumLineLength": null
}
13 changes: 11 additions & 2 deletions Gruntfile.js
Expand Up @@ -54,6 +54,15 @@ grunt.initConfig({
"build/*.js"
]
},
jscs: {
options: {
config: ".jscsrc"
},
all: [
"<%= jshint.all %>",
"!test/deepEqual.js"
]
},
qunit: {
options: {
timeout: 30000,
Expand Down Expand Up @@ -112,7 +121,7 @@ grunt.registerTask( "testswarm", function( commit, configFile, projectName, brow
}
timeout = timeout || 1000 * 60 * 15;

[ "index", "async", "setTimeout" ].forEach(function ( suite ) {
[ "index", "async", "setTimeout" ].forEach(function( suite ) {
runs[ suite ] = config.testUrl + commit + "/test/" + suite + ".html";
});

Expand Down Expand Up @@ -187,6 +196,6 @@ grunt.registerTask( "test-on-node", function() {
});

grunt.registerTask( "build", [ "concat" ] );
grunt.registerTask( "default", [ "build", "jshint", "qunit", "test-on-node" ] );
grunt.registerTask( "default", [ "build", "jshint", "jscs", "qunit", "test-on-node" ] );

};
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -40,6 +40,7 @@
"grunt-contrib-watch": "0.5.3",
"grunt-coveralls": "0.3.0",
"grunt-git-authors": "1.2.0",
"grunt-jscs": "0.6.1",
"grunt-qunit-istanbul": "0.4.5",
"load-grunt-tasks": "0.3.0",
"testswarm": "1.1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/equiv.js
Expand Up @@ -197,7 +197,7 @@ QUnit.equiv = (function() {
return true; // end transition
}

return ( function( a, b ) {
return ( (function( a, b ) {
if ( a === b ) {
return true; // catch the most you can
} else if ( a === null || b === null || typeof a === "undefined" ||
Expand All @@ -211,7 +211,7 @@ QUnit.equiv = (function() {
}

// apply transition with (1..n) arguments
}( args[ 0 ], args[ 1 ] ) && innerEquiv.apply( this, args.splice( 1, args.length - 1 ) ) );
}( args[ 0 ], args[ 1 ] ) ) && innerEquiv.apply( this, args.splice( 1, args.length - 1 ) ) );
};

return innerEquiv;
Expand Down
1 change: 0 additions & 1 deletion src/outro.js
@@ -1,4 +1,3 @@

// Get a reference to the global object, like window in browsers
}( (function() {
return this;
Expand Down

0 comments on commit 25e95df

Please sign in to comment.