]> source.dussan.org Git - jquery-ui.git/commitdiff
Build: Upgrade to the latest Grunt and JSHint - Closes gh-786
authorMike Sherov <mike.sherov@gmail.com>
Mon, 22 Oct 2012 21:41:54 +0000 (17:41 -0400)
committerCorey Frang <gnarf@gnarf.net>
Mon, 22 Oct 2012 22:04:08 +0000 (17:04 -0500)
12 files changed:
.jshintrc
build/.jshintrc [deleted file]
build/release/release.js
build/tasks/build.js
build/tasks/testswarm.js
grunt.js
package.json
tests/.jshintrc
tests/unit/datepicker/datepicker_tickets.js
tests/unit/testsuite.js
ui/.jshintrc
ui/jquery.ui.autocomplete.js

index 99161bd4e35cadd0ada53f81edf42e2d2df26881..e22109220d0e2d070f5b38b4a84b4251a0e69011 100644 (file)
--- a/.jshintrc
+++ b/.jshintrc
@@ -3,10 +3,9 @@
        "eqnull": true,
        "eqeqeq": true,
        "expr": true,
-       "latedef": true,
        "noarg": true,
+       "node": true,
        "onevar": true,
-       "smarttabs": true,
        "trailing": true,
        "undef": true
 }
diff --git a/build/.jshintrc b/build/.jshintrc
deleted file mode 100644 (file)
index 9e6abf3..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-       "curly": true,
-       "eqnull": true,
-       "eqeqeq": true,
-       "expr": true,
-       "noarg": true,
-       "node": true,
-       "onevar": true,
-       "smarttabs": true,
-       "strict": false,
-       "trailing": true,
-       "undef": true
-}
index 77430d8d16f2d2215f26b9aa8452c0be08005920..ae705a90fc519f2921e8fbc078f4301330cd21ff 100644 (file)
@@ -1,6 +1,8 @@
 #!/usr/bin/env node
 /*global cat:true cd:true cp:true echo:true exec:true exit:true ls:true*/
 
+"use strict";
+
 var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime,
        fs = require( "fs" ),
        path = require( "path" ),
index 3f3dd31c55c12bc1718119c83002d7ef5fdd3c64..b59c728d30b235cf8a3fd6175c62b81def8f075a 100644 (file)
@@ -1,6 +1,9 @@
 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() {
        var pkg = grunt.config( "pkg" ),
index 34c17d4f6b5c84fc1cb768ba83471425a7eaa247..244113786c6c3fedf9407424ca3030dd79120948 100644 (file)
@@ -1,6 +1,7 @@
-/*jshint node: true */
 module.exports = function( grunt ) {
 
+"use strict";
+
 var versions = {
                "git": "git",
                "1.8": "1.8.0 1.8.1 1.8.2",
index 9e03c95fac409d0fca55cb25e421710e2c05628f..6e8655b409a47481c036e11f9f98f7d29401ed25 100644 (file)
--- a/grunt.js
+++ b/grunt.js
@@ -1,6 +1,7 @@
-/*jshint node: true */
 module.exports = function( grunt ) {
 
+"use strict";
+
 var
        // files
        coreFiles = [
@@ -326,9 +327,7 @@ grunt.initConfig({
                }
 
                return {
-                       // TODO: use "faux strict mode" https://github.com/jshint/jshint/issues/504
-                       // TODO: limit `smarttabs` to multi-line comments https://github.com/jshint/jshint/issues/503
-                       options: parserc(),
+                       grunt: parserc(),
                        ui: parserc( "ui/" ),
                        // TODO: `evil: true` is only for document.write() https://github.com/jshint/jshint/issues/519
                        // TODO: don't create so many globals in tests
index 3625c1f442b9c26f330ae3c5ecfe9b609aaf0613..110a23a6e72c93d19dd0f3ac1de79115edbddd11 100644 (file)
@@ -48,7 +48,7 @@
        ],
        "dependencies": {},
        "devDependencies": {
-               "grunt": "~0.3.9",
+               "grunt": "~0.3.17",
                "grunt-css": "0.2.0",
                "grunt-compare-size": "0.1.4",
                "grunt-html": "0.1.1",
index 783237218351d43a199e3c153a9f6ef1e2723091..20094d43633acccae0a71be454eb0ffcf180600d 100644 (file)
@@ -9,7 +9,6 @@
        "latedef": true,
        "noarg": true,
        "onevar": true,
-       "smarttabs": true,
        "trailing": true,
        "undef": true,
        "predef": [
index e1b882a89e994904151f7333a619cb24a6797b5b..57b25c3fff299b2d2a7d1e3dc78e642caf3e877a 100644 (file)
@@ -7,9 +7,9 @@ module("datepicker: tickets");
 
 // http://forum.jquery.com/topic/several-breaking-changes-in-jquery-ui-1-8rc1
 test('beforeShowDay-getDate', function() {
-    expect( 3 );
+       expect( 3 );
        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');
        // contains non-breaking space
        equal($('div.ui-datepicker-title').text(), 'January 2010', 'Initial month');
@@ -26,63 +26,63 @@ test('beforeShowDay-getDate', function() {
 });
 
 test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler', function(){
-    expect( 3 );
-    var inp = init('#inp',{
-            beforeShow: function(){
-                return false;
-            }
-        }),
-        dp = $('#ui-datepicker-div');
-    inp.datepicker('show');
-    equal(dp.css('display'), 'none',"beforeShow returns false");
-    inp.datepicker('destroy');
+       expect( 3 );
+       var inp = init('#inp',{
+                       beforeShow: function(){
+                               return false;
+                       }
+               }),
+               dp = $('#ui-datepicker-div');
+       inp.datepicker('show');
+       equal(dp.css('display'), 'none',"beforeShow returns false");
+       inp.datepicker('destroy');
 
-    inp = init('#inp',{
-        beforeShow: function(){
-        }
-    });
-    dp = $('#ui-datepicker-div');
-    inp.datepicker('show');
-    equal(dp.css('display'), 'block',"beforeShow returns nothing");
+       inp = init('#inp',{
+               beforeShow: function(){
+               }
+       });
+       dp = $('#ui-datepicker-div');
+       inp.datepicker('show');
+       equal(dp.css('display'), 'block',"beforeShow returns nothing");
        inp.datepicker('hide');
-    inp.datepicker('destroy');
+       inp.datepicker('destroy');
 
-    inp = init('#inp',{
-        beforeShow: function(){
-            return true;
-        }
-    });
-    dp = $('#ui-datepicker-div');
-    inp.datepicker('show');
-    equal(dp.css('display'), 'block',"beforeShow returns true");
+       inp = init('#inp',{
+               beforeShow: function(){
+                       return true;
+               }
+       });
+       dp = $('#ui-datepicker-div');
+       inp.datepicker('show');
+       equal(dp.css('display'), 'block',"beforeShow returns true");
        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(){
-    expect( 1 );
-    var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
-    equal(time, "089");
+       expect( 1 );
+       var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
+       equal(time, "089");
 });
 
 test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() {
-    expect( 4 );
-    var date;
-    try{
-        date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881');
-        ok(false, "Did not properly detect an invalid date");
-    }catch(e){
-        ok("invalid date detected");
-    }
+       expect( 4 );
+       var date;
+       try{
+               date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881');
+               ok(false, "Did not properly detect an invalid date");
+       }catch(e){
+               ok("invalid date detected");
+       }
 
-    try {
-      date = $.datepicker.parseDate('dd/mm/yy', '18/04/1988 @ 2:43 pm');
-      equal(date.getDate(), 18);
-      equal(date.getMonth(), 3);
-      equal(date.getFullYear(), 1988);
-    } catch(e) {
-      ok(false, "Did not properly parse date with extra text separated by whitespace");
-    }
+       try {
+               date = $.datepicker.parseDate('dd/mm/yy', '18/04/1988 @ 2:43 pm');
+               equal(date.getDate(), 18);
+               equal(date.getMonth(), 3);
+               equal(date.getFullYear(), 1988);
+       } catch(e) {
+               ok(false, "Did not properly parse date with extra text separated by whitespace");
+       }
 });
 
 })(jQuery);
index 06890d8d91d33807a520694d915c8a97a4d0446f..74a561c0d27a600e6fcfbcec6bca3c2ae1b15490 100644 (file)
@@ -12,6 +12,10 @@ function includeScript( url ) {
        document.write( "<script src='../../../" + url + "'></script>" );
 }
 
+function url( value ) {
+       return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random() * 100000, 10);
+}
+
 reset = QUnit.reset;
 QUnit.reset = function() {
        // Ensure jQuery events and data on the fixture are properly removed
@@ -65,11 +69,11 @@ TestHelpers.testJshint = function( module ) {
 
                $.when(
                        $.ajax({
-                               url: "../../../ui/.jshintrc",
+                               url: url("../../../ui/.jshintrc"),
                                dataType: "json"
                        }),
                        $.ajax({
-                               url: "../../../ui/jquery.ui." + module + ".js",
+                               url: url("../../../ui/jquery.ui." + module + ".js"),
                                dataType: "text"
                        })
                ).done(function( hintArgs, srcArgs ) {
index 415d69e90573fc7cf62186d4579d57557e878688..26b8087740206dffaa74f774c2b1fd7fb317e7dc 100644 (file)
@@ -8,7 +8,6 @@
        "latedef": true,
        "noarg": true,
        "onevar": true,
-       "smarttabs": true,
        "trailing": true,
        "undef": true,
        "predef": [
index f181e91805e37a11bb206564379dca66327be992..aec12bf8f3f9411a0aaa19e2de10d88d666959b0 100644 (file)
@@ -292,7 +292,7 @@ $.widget( "ui.autocomplete", {
                        .insertAfter( this.element );
 
                if ( $.fn.bgiframe ) {
-                        this.menu.element.bgiframe();
+                       this.menu.element.bgiframe();
                }
 
                // turning off autocomplete prevents the browser from remembering the