No ticket. Restore checking individual src/**/*.js files by jsHint.

This commit is contained in:
Michał Gołębiowski 2013-09-06 20:31:48 +02:00
parent 6987220d2b
commit f044622bae
23 changed files with 42 additions and 32 deletions

View File

@ -1,3 +1,5 @@
src/intro.js
src/outro.js
test/qunit/** test/qunit/**
test/data/jquery-1.9.1.ajax_xhr.min.js test/data/jquery-1.9.1.ajax_xhr.min.js
test/data/badcall.js test/data/badcall.js

View File

@ -53,6 +53,12 @@ module.exports = function( grunt ) {
} }
}, },
jshint: { jshint: {
src: {
src: [ "src/**/*.js" ],
options: {
jshintrc: "src/.jshintrc"
}
},
dist: { dist: {
src: [ "dist/jquery.js" ], src: [ "dist/jquery.js" ],
options: srcHintOptions options: srcHintOptions

View File

@ -71,4 +71,4 @@ jQuery.fn.load = function( url, params, callback ) {
return this; return this;
}; };
}); });

View File

@ -1,3 +1,3 @@
define(function() { define(function() {
return /\?/; return (/\?/);
}); });

View File

@ -1,3 +1,3 @@
define(function() { define(function() {
return [ "Top", "Right", "Bottom", "Left" ]; return [ "Top", "Right", "Bottom", "Left" ];
}); });

View File

@ -1,11 +1,11 @@
define([ define([
"../core", "../core",
"../selector", "../selector",
"../effects", "../effects"
], function( jQuery ) { ], function( jQuery ) {
jQuery.expr.filters.animated = function( elem ) { jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) { return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem; return elem === fn.elem;
}).length; }).length;
}; };
}); });

View File

@ -15,4 +15,4 @@ if ( typeof define === "function" && define.amd ) {
}); });
} }
}); });

View File

@ -1,3 +1,3 @@
define(function() { define(function() {
return /^(?:checkbox|radio)$/i; return (/^(?:checkbox|radio)$/i);
}); });

View File

@ -47,19 +47,21 @@ jQuery.fn.offset = function( options ) {
jQuery.offset = { jQuery.offset = {
setOffset: function( elem, options, i ) { 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 // set position first, in-case top/left are set even on static elem
if ( position === "static" ) { if ( position === "static" ) {
elem.style.position = "relative"; elem.style.position = "relative";
} }
var curElem = jQuery( elem ), curOffset = curElem.offset();
curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" );
curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" );
curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) &&
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1;
props = {}, curPosition = {}, curTop, curLeft;
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
if ( calculatePosition ) { if ( calculatePosition ) {

View File

@ -1 +1 @@
})); }));

View File

@ -1 +1 @@
define([ "./selector-sizzle" ]); define([ "./selector-sizzle" ]);

View File

@ -1,3 +1,3 @@
define(function() { define(function() {
return {}; return {};
}); });

View File

@ -2,4 +2,4 @@ define([
"./deletedIds" "./deletedIds"
], function( deletedIds ) { ], function( deletedIds ) {
return deletedIds.concat; return deletedIds.concat;
}); });

View File

@ -1,3 +1,3 @@
define(function() { define(function() {
return []; return [];
}); });

View File

@ -2,4 +2,4 @@ define([
"./class2type" "./class2type"
], function( class2type ) { ], function( class2type ) {
return class2type.hasOwnProperty; return class2type.hasOwnProperty;
}); });

View File

@ -2,4 +2,4 @@ define([
"./deletedIds" "./deletedIds"
], function( deletedIds ) { ], function( deletedIds ) {
return deletedIds.indexOf; return deletedIds.indexOf;
}); });

View File

@ -1,3 +1,3 @@
define(function() { define(function() {
return /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
}); });

View File

@ -2,4 +2,4 @@ define([
"./deletedIds" "./deletedIds"
], function( deletedIds ) { ], function( deletedIds ) {
return deletedIds.push; return deletedIds.push;
}); });

View File

@ -1,3 +1,3 @@
define(function() { define(function() {
return /\S+/g; return (/\S+/g);
}); });

View File

@ -2,4 +2,4 @@ define([
"./deletedIds" "./deletedIds"
], function( deletedIds ) { ], function( deletedIds ) {
return deletedIds.slice; return deletedIds.slice;
}); });

View File

@ -1,3 +1,3 @@
define(function() { define(function() {
return typeof undefined; return typeof undefined;
}); });

View File

@ -2,4 +2,4 @@ define([
"./class2type" "./class2type"
], function( class2type ) { ], function( class2type ) {
return class2type.toString; return class2type.toString;
}); });

View File

@ -1,3 +1,3 @@
define(function() { define(function() {
return "".trim; return "".trim;
}); });