From f044622bae3853abe8dc142585e9ba881b1c7ebd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Fri, 6 Sep 2013 20:31:48 +0200 Subject: [PATCH] No ticket. Restore checking individual src/**/*.js files by jsHint. --- .jshintignore | 2 ++ Gruntfile.js | 6 ++++++ src/ajax/load.js | 2 +- src/ajax/var/rquery.js | 4 ++-- src/css/var/cssExpand.js | 2 +- src/effects/animatedSelector.js | 4 ++-- src/exports/amd.js | 2 +- src/manipulation/var/rcheckableType.js | 4 ++-- src/offset.js | 16 +++++++++------- src/outro.js | 2 +- src/selector.js | 2 +- src/var/class2type.js | 2 +- src/var/concat.js | 2 +- src/var/deletedIds.js | 2 +- src/var/hasOwn.js | 2 +- src/var/indexOf.js | 2 +- src/var/pnum.js | 4 ++-- src/var/push.js | 2 +- src/var/rnotwhite.js | 4 ++-- src/var/slice.js | 2 +- src/var/strundefined.js | 2 +- src/var/toString.js | 2 +- src/var/trim.js | 2 +- 23 files changed, 42 insertions(+), 32 deletions(-) diff --git a/.jshintignore b/.jshintignore index 894187dc1..ae3c3de80 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,3 +1,5 @@ +src/intro.js +src/outro.js test/qunit/** test/data/jquery-1.9.1.ajax_xhr.min.js test/data/badcall.js diff --git a/Gruntfile.js b/Gruntfile.js index e62255720..a4215b558 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -53,6 +53,12 @@ module.exports = function( grunt ) { } }, jshint: { + src: { + src: [ "src/**/*.js" ], + options: { + jshintrc: "src/.jshintrc" + } + }, dist: { src: [ "dist/jquery.js" ], options: srcHintOptions diff --git a/src/ajax/load.js b/src/ajax/load.js index dde1823c0..d8e7e57c4 100644 --- a/src/ajax/load.js +++ b/src/ajax/load.js @@ -71,4 +71,4 @@ jQuery.fn.load = function( url, params, callback ) { return this; }; -}); \ No newline at end of file +}); diff --git a/src/ajax/var/rquery.js b/src/ajax/var/rquery.js index eb26d4eb8..500a77a08 100644 --- a/src/ajax/var/rquery.js +++ b/src/ajax/var/rquery.js @@ -1,3 +1,3 @@ define(function() { - return /\?/; -}); \ No newline at end of file + return (/\?/); +}); diff --git a/src/css/var/cssExpand.js b/src/css/var/cssExpand.js index 5bb6e8f85..91e90a88a 100644 --- a/src/css/var/cssExpand.js +++ b/src/css/var/cssExpand.js @@ -1,3 +1,3 @@ define(function() { return [ "Top", "Right", "Bottom", "Left" ]; -}); \ No newline at end of file +}); diff --git a/src/effects/animatedSelector.js b/src/effects/animatedSelector.js index 290e32bfa..c9fa68950 100644 --- a/src/effects/animatedSelector.js +++ b/src/effects/animatedSelector.js @@ -1,11 +1,11 @@ define([ "../core", "../selector", - "../effects", + "../effects" ], function( jQuery ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; -}); \ No newline at end of file +}); diff --git a/src/exports/amd.js b/src/exports/amd.js index 4499d2def..815b5d88a 100644 --- a/src/exports/amd.js +++ b/src/exports/amd.js @@ -15,4 +15,4 @@ if ( typeof define === "function" && define.amd ) { }); } -}); \ No newline at end of file +}); diff --git a/src/manipulation/var/rcheckableType.js b/src/manipulation/var/rcheckableType.js index 29049b3ae..c27a15dc4 100644 --- a/src/manipulation/var/rcheckableType.js +++ b/src/manipulation/var/rcheckableType.js @@ -1,3 +1,3 @@ define(function() { - return /^(?:checkbox|radio)$/i; -}); \ No newline at end of file + return (/^(?:checkbox|radio)$/i); +}); diff --git a/src/offset.js b/src/offset.js index 9172a715d..93c5018a8 100644 --- a/src/offset.js +++ b/src/offset.js @@ -47,19 +47,21 @@ jQuery.fn.offset = function( options ) { jQuery.offset = { setOffset: function( elem, options, i ) { - var position = jQuery.css( elem, "position" ); + var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, + position = jQuery.css( elem, "position" ), + curElem = jQuery( elem ), + props = {}; // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } - var curElem = jQuery( elem ), - curOffset = curElem.offset(), - curCSSTop = jQuery.css( elem, "top" ), - curCSSLeft = jQuery.css( elem, "left" ), - calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, - props = {}, curPosition = {}, curTop, curLeft; + curOffset = curElem.offset(); + curCSSTop = jQuery.css( elem, "top" ); + curCSSLeft = jQuery.css( elem, "left" ); + calculatePosition = ( position === "absolute" || position === "fixed" ) && + jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { diff --git a/src/outro.js b/src/outro.js index 57d3e4820..be4600a5c 100644 --- a/src/outro.js +++ b/src/outro.js @@ -1 +1 @@ -})); \ No newline at end of file +})); diff --git a/src/selector.js b/src/selector.js index f47632b87..01e9733b8 100644 --- a/src/selector.js +++ b/src/selector.js @@ -1 +1 @@ -define([ "./selector-sizzle" ]); \ No newline at end of file +define([ "./selector-sizzle" ]); diff --git a/src/var/class2type.js b/src/var/class2type.js index d31b7afcd..52f2d38a6 100644 --- a/src/var/class2type.js +++ b/src/var/class2type.js @@ -1,3 +1,3 @@ define(function() { return {}; -}); \ No newline at end of file +}); diff --git a/src/var/concat.js b/src/var/concat.js index e7d4ce26c..8606ea34c 100644 --- a/src/var/concat.js +++ b/src/var/concat.js @@ -2,4 +2,4 @@ define([ "./deletedIds" ], function( deletedIds ) { return deletedIds.concat; -}); \ No newline at end of file +}); diff --git a/src/var/deletedIds.js b/src/var/deletedIds.js index 39efc6a70..b18fc9ce0 100644 --- a/src/var/deletedIds.js +++ b/src/var/deletedIds.js @@ -1,3 +1,3 @@ define(function() { return []; -}); \ No newline at end of file +}); diff --git a/src/var/hasOwn.js b/src/var/hasOwn.js index 2fd59e1f7..32c002aff 100644 --- a/src/var/hasOwn.js +++ b/src/var/hasOwn.js @@ -2,4 +2,4 @@ define([ "./class2type" ], function( class2type ) { return class2type.hasOwnProperty; -}); \ No newline at end of file +}); diff --git a/src/var/indexOf.js b/src/var/indexOf.js index 5aaf79a49..fafddd437 100644 --- a/src/var/indexOf.js +++ b/src/var/indexOf.js @@ -2,4 +2,4 @@ define([ "./deletedIds" ], function( deletedIds ) { return deletedIds.indexOf; -}); \ No newline at end of file +}); diff --git a/src/var/pnum.js b/src/var/pnum.js index d1af1e67b..407044724 100644 --- a/src/var/pnum.js +++ b/src/var/pnum.js @@ -1,3 +1,3 @@ define(function() { - return /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; -}); \ No newline at end of file + return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; +}); diff --git a/src/var/push.js b/src/var/push.js index b8f06d8b9..cc1e105bf 100644 --- a/src/var/push.js +++ b/src/var/push.js @@ -2,4 +2,4 @@ define([ "./deletedIds" ], function( deletedIds ) { return deletedIds.push; -}); \ No newline at end of file +}); diff --git a/src/var/rnotwhite.js b/src/var/rnotwhite.js index 887c82985..7c69bec53 100644 --- a/src/var/rnotwhite.js +++ b/src/var/rnotwhite.js @@ -1,3 +1,3 @@ define(function() { - return /\S+/g; -}); \ No newline at end of file + return (/\S+/g); +}); diff --git a/src/var/slice.js b/src/var/slice.js index b6bd578a6..d47618a8d 100644 --- a/src/var/slice.js +++ b/src/var/slice.js @@ -2,4 +2,4 @@ define([ "./deletedIds" ], function( deletedIds ) { return deletedIds.slice; -}); \ No newline at end of file +}); diff --git a/src/var/strundefined.js b/src/var/strundefined.js index 99a26f44a..04e16b03e 100644 --- a/src/var/strundefined.js +++ b/src/var/strundefined.js @@ -1,3 +1,3 @@ define(function() { return typeof undefined; -}); \ No newline at end of file +}); diff --git a/src/var/toString.js b/src/var/toString.js index db39811b6..ca92d2222 100644 --- a/src/var/toString.js +++ b/src/var/toString.js @@ -2,4 +2,4 @@ define([ "./class2type" ], function( class2type ) { return class2type.toString; -}); \ No newline at end of file +}); diff --git a/src/var/trim.js b/src/var/trim.js index e5d414aca..18f835658 100644 --- a/src/var/trim.js +++ b/src/var/trim.js @@ -1,3 +1,3 @@ define(function() { return "".trim; -}); \ No newline at end of file +}); -- 2.39.5