Skip to content

Commit

Permalink
Build: Upgrade to the latest Grunt and JSHint - Closes gh-786
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesherov authored and gnarf committed Oct 22, 2012
1 parent 9b90887 commit d67522e
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 75 deletions.
3 changes: 1 addition & 2 deletions .jshintrc
Expand Up @@ -3,10 +3,9 @@
"eqnull": true, "eqnull": true,
"eqeqeq": true, "eqeqeq": true,
"expr": true, "expr": true,
"latedef": true,
"noarg": true, "noarg": true,
"node": true,
"onevar": true, "onevar": true,
"smarttabs": true,
"trailing": true, "trailing": true,
"undef": true "undef": true
} }
13 changes: 0 additions & 13 deletions build/.jshintrc

This file was deleted.

2 changes: 2 additions & 0 deletions build/release/release.js
@@ -1,6 +1,8 @@
#!/usr/bin/env node #!/usr/bin/env node
/*global cat:true cd:true cp:true echo:true exec:true exit:true ls:true*/ /*global cat:true cd:true cp:true echo:true exec:true exit:true ls:true*/


"use strict";

var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime, var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime,
fs = require( "fs" ), fs = require( "fs" ),
path = require( "path" ), path = require( "path" ),
Expand Down
5 changes: 4 additions & 1 deletion build/tasks/build.js
@@ -1,6 +1,9 @@
module.exports = function( grunt ) { module.exports = function( grunt ) {


var path = require( "path" ); "use strict";

var path = require( "path" ),
fs = require( "fs" );


grunt.registerTask( "manifest", "Generate jquery.json manifest files", function() { grunt.registerTask( "manifest", "Generate jquery.json manifest files", function() {
var pkg = grunt.config( "pkg" ), var pkg = grunt.config( "pkg" ),
Expand Down
3 changes: 2 additions & 1 deletion build/tasks/testswarm.js
@@ -1,6 +1,7 @@
/*jshint node: true */
module.exports = function( grunt ) { module.exports = function( grunt ) {


"use strict";

var versions = { var versions = {
"git": "git", "git": "git",
"1.8": "1.8.0 1.8.1 1.8.2", "1.8": "1.8.0 1.8.1 1.8.2",
Expand Down
7 changes: 3 additions & 4 deletions grunt.js
@@ -1,6 +1,7 @@
/*jshint node: true */
module.exports = function( grunt ) { module.exports = function( grunt ) {


"use strict";

var var
// files // files
coreFiles = [ coreFiles = [
Expand Down Expand Up @@ -326,9 +327,7 @@ grunt.initConfig({
} }


return { return {
// TODO: use "faux strict mode" https://github.com/jshint/jshint/issues/504 grunt: parserc(),
// TODO: limit `smarttabs` to multi-line comments https://github.com/jshint/jshint/issues/503
options: parserc(),
ui: parserc( "ui/" ), ui: parserc( "ui/" ),
// TODO: `evil: true` is only for document.write() https://github.com/jshint/jshint/issues/519 // TODO: `evil: true` is only for document.write() https://github.com/jshint/jshint/issues/519
// TODO: don't create so many globals in tests // TODO: don't create so many globals in tests
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -48,7 +48,7 @@
], ],
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"grunt": "~0.3.9", "grunt": "~0.3.17",
"grunt-css": "0.2.0", "grunt-css": "0.2.0",
"grunt-compare-size": "0.1.4", "grunt-compare-size": "0.1.4",
"grunt-html": "0.1.1", "grunt-html": "0.1.1",
Expand Down
1 change: 0 additions & 1 deletion tests/.jshintrc
Expand Up @@ -9,7 +9,6 @@
"latedef": true, "latedef": true,
"noarg": true, "noarg": true,
"onevar": true, "onevar": true,
"smarttabs": true,
"trailing": true, "trailing": true,
"undef": true, "undef": true,
"predef": [ "predef": [
Expand Down
96 changes: 48 additions & 48 deletions tests/unit/datepicker/datepicker_tickets.js
Expand Up @@ -7,9 +7,9 @@ module("datepicker: tickets");


// http://forum.jquery.com/topic/several-breaking-changes-in-jquery-ui-1-8rc1 // http://forum.jquery.com/topic/several-breaking-changes-in-jquery-ui-1-8rc1
test('beforeShowDay-getDate', function() { test('beforeShowDay-getDate', function() {
expect( 3 ); expect( 3 );
var inp = init('#inp', {beforeShowDay: function(date) { inp.datepicker('getDate'); return [true, '']; }}), var inp = init('#inp', {beforeShowDay: function(date) { inp.datepicker('getDate'); return [true, '']; }}),
dp = $('#ui-datepicker-div'); dp = $('#ui-datepicker-div');
inp.val('01/01/2010').datepicker('show'); inp.val('01/01/2010').datepicker('show');
// contains non-breaking space // contains non-breaking space
equal($('div.ui-datepicker-title').text(), 'January 2010', 'Initial month'); equal($('div.ui-datepicker-title').text(), 'January 2010', 'Initial month');
Expand All @@ -26,63 +26,63 @@ test('beforeShowDay-getDate', function() {
}); });


test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler', function(){ test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler', function(){
expect( 3 ); expect( 3 );
var inp = init('#inp',{ var inp = init('#inp',{
beforeShow: function(){ beforeShow: function(){
return false; return false;
} }
}), }),
dp = $('#ui-datepicker-div'); dp = $('#ui-datepicker-div');
inp.datepicker('show'); inp.datepicker('show');
equal(dp.css('display'), 'none',"beforeShow returns false"); equal(dp.css('display'), 'none',"beforeShow returns false");
inp.datepicker('destroy'); inp.datepicker('destroy');


inp = init('#inp',{ inp = init('#inp',{
beforeShow: function(){ beforeShow: function(){
} }
}); });
dp = $('#ui-datepicker-div'); dp = $('#ui-datepicker-div');
inp.datepicker('show'); inp.datepicker('show');
equal(dp.css('display'), 'block',"beforeShow returns nothing"); equal(dp.css('display'), 'block',"beforeShow returns nothing");
inp.datepicker('hide'); inp.datepicker('hide');
inp.datepicker('destroy'); inp.datepicker('destroy');


inp = init('#inp',{ inp = init('#inp',{
beforeShow: function(){ beforeShow: function(){
return true; return true;
} }
}); });
dp = $('#ui-datepicker-div'); dp = $('#ui-datepicker-div');
inp.datepicker('show'); inp.datepicker('show');
equal(dp.css('display'), 'block',"beforeShow returns true"); equal(dp.css('display'), 'block',"beforeShow returns true");
inp.datepicker('hide'); inp.datepicker('hide');
inp.datepicker('destroy'); inp.datepicker('destroy');
}); });


test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){ test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){
expect( 1 ); expect( 1 );
var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT")); var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
equal(time, "089"); equal(time, "089");
}); });


test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() { test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() {
expect( 4 ); expect( 4 );
var date; var date;
try{ try{
date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881'); date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881');
ok(false, "Did not properly detect an invalid date"); ok(false, "Did not properly detect an invalid date");
}catch(e){ }catch(e){
ok("invalid date detected"); ok("invalid date detected");
} }


try { try {
date = $.datepicker.parseDate('dd/mm/yy', '18/04/1988 @ 2:43 pm'); date = $.datepicker.parseDate('dd/mm/yy', '18/04/1988 @ 2:43 pm');
equal(date.getDate(), 18); equal(date.getDate(), 18);
equal(date.getMonth(), 3); equal(date.getMonth(), 3);
equal(date.getFullYear(), 1988); equal(date.getFullYear(), 1988);
} catch(e) { } catch(e) {
ok(false, "Did not properly parse date with extra text separated by whitespace"); ok(false, "Did not properly parse date with extra text separated by whitespace");
} }
}); });


})(jQuery); })(jQuery);
8 changes: 6 additions & 2 deletions tests/unit/testsuite.js
Expand Up @@ -12,6 +12,10 @@ function includeScript( url ) {
document.write( "<script src='../../../" + url + "'></script>" ); document.write( "<script src='../../../" + url + "'></script>" );
} }


function url( value ) {
return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random() * 100000, 10);
}

reset = QUnit.reset; reset = QUnit.reset;
QUnit.reset = function() { QUnit.reset = function() {
// Ensure jQuery events and data on the fixture are properly removed // Ensure jQuery events and data on the fixture are properly removed
Expand Down Expand Up @@ -65,11 +69,11 @@ TestHelpers.testJshint = function( module ) {


$.when( $.when(
$.ajax({ $.ajax({
url: "../../../ui/.jshintrc", url: url("../../../ui/.jshintrc"),
dataType: "json" dataType: "json"
}), }),
$.ajax({ $.ajax({
url: "../../../ui/jquery.ui." + module + ".js", url: url("../../../ui/jquery.ui." + module + ".js"),
dataType: "text" dataType: "text"
}) })
).done(function( hintArgs, srcArgs ) { ).done(function( hintArgs, srcArgs ) {
Expand Down
1 change: 0 additions & 1 deletion ui/.jshintrc
Expand Up @@ -8,7 +8,6 @@
"latedef": true, "latedef": true,
"noarg": true, "noarg": true,
"onevar": true, "onevar": true,
"smarttabs": true,
"trailing": true, "trailing": true,
"undef": true, "undef": true,
"predef": [ "predef": [
Expand Down
2 changes: 1 addition & 1 deletion ui/jquery.ui.autocomplete.js
Expand Up @@ -292,7 +292,7 @@ $.widget( "ui.autocomplete", {
.insertAfter( this.element ); .insertAfter( this.element );


if ( $.fn.bgiframe ) { if ( $.fn.bgiframe ) {
this.menu.element.bgiframe(); this.menu.element.bgiframe();
} }


// turning off autocomplete prevents the browser from remembering the // turning off autocomplete prevents the browser from remembering the
Expand Down

0 comments on commit d67522e

Please sign in to comment.