aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/.eslintrc29
-rw-r--r--src/ajax.js1
-rw-r--r--src/attributes/val.js5
-rw-r--r--src/core.js14
-rw-r--r--src/css/adjustCSS.js8
-rw-r--r--src/data/var/acceptData.js1
-rw-r--r--src/deferred.js2
-rw-r--r--src/effects.js16
-rw-r--r--src/exports/global.js2
-rw-r--r--src/manipulation.js6
-rw-r--r--src/selector.js4
-rw-r--r--src/traversing/findFilter.js1
-rw-r--r--src/wrapper.js6
13 files changed, 59 insertions, 36 deletions
diff --git a/src/.eslintrc b/src/.eslintrc
index ef090331f..dbf16c584 100644
--- a/src/.eslintrc
+++ b/src/.eslintrc
@@ -1,15 +1,18 @@
{
- "env": {
- "browser"
- },
- "extends": "../.eslintrc",
- "root": true,
- "globals": {
- "window": true,
- "JSON": false,
- "jQuery": true,
- "define": true,
- "module": true,
- "noGlobal": true
- }
+ // Support: IE <=9 only, Android <=4.0 only
+ // The above browsers are failing a lot of tests in the ES5
+ // test suite at http://test262.ecmascript.org.
+ "parserOptions": {
+ "ecmaVersion": 3
+ },
+ "globals": {
+ "window": true,
+ "jQuery": true,
+ "define": true,
+ "module": true,
+ "noGlobal": true
+ },
+ "rules": {
+ "strict": ["error", "function"]
+ }
}
diff --git a/src/ajax.js b/src/ajax.js
index 2bb03883d..85b08546f 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -306,6 +306,7 @@ jQuery.extend( {
processData: true,
async: true,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+
/*
timeout: 0,
data: null,
diff --git a/src/attributes/val.js b/src/attributes/val.js
index 757680607..1ba42a5c8 100644
--- a/src/attributes/val.js
+++ b/src/attributes/val.js
@@ -143,11 +143,16 @@ jQuery.extend( {
while ( i-- ) {
option = options[ i ];
+
+ /* eslint-disable no-cond-assign */
+
if ( option.selected =
jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
) {
optionSet = true;
}
+
+ /* eslint-enable no-cond-assign */
}
// Force browsers to behave consistently when non-matching value is set
diff --git a/src/core.js b/src/core.js
index 9dd05294e..5bdb2169c 100644
--- a/src/core.js
+++ b/src/core.js
@@ -1,3 +1,7 @@
+/* global Symbol */
+// Defining this global in .eslintrc would create a danger of using the global
+// unguarded in another place, it seems safer to define global only for this module
+
define( [
"./var/arr",
"./var/document",
@@ -252,7 +256,11 @@ jQuery.extend( {
},
isEmptyObject: function( obj ) {
+
+ /* eslint-disable no-unused-vars */
+ // See https://github.com/eslint/eslint/issues/6125
var name;
+
for ( name in obj ) {
return false;
}
@@ -442,15 +450,9 @@ jQuery.extend( {
support: support
} );
-// JSHint would error on this code due to the Symbol not being defined in ES5.
-// Defining this global in .jshintrc would create a danger of using the global
-// unguarded in another place, it seems safer to just disable JSHint for these
-// three lines.
-/* jshint ignore: start */
if ( typeof Symbol === "function" ) {
jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
}
-/* jshint ignore: end */
// Populate the class2type map
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
diff --git a/src/css/adjustCSS.js b/src/css/adjustCSS.js
index f1d1f00ce..ded3a1666 100644
--- a/src/css/adjustCSS.js
+++ b/src/css/adjustCSS.js
@@ -10,8 +10,12 @@ function adjustCSS( elem, prop, valueParts, tween ) {
scale = 1,
maxIterations = 20,
currentValue = tween ?
- function() { return tween.cur(); } :
- function() { return jQuery.css( elem, prop, "" ); },
+ function() {
+ return tween.cur();
+ } :
+ function() {
+ return jQuery.css( elem, prop, "" );
+ },
initial = currentValue(),
unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
diff --git a/src/data/var/acceptData.js b/src/data/var/acceptData.js
index 7d0fb238e..e00f7538b 100644
--- a/src/data/var/acceptData.js
+++ b/src/data/var/acceptData.js
@@ -13,7 +13,6 @@ return function( owner ) {
// - Node.DOCUMENT_NODE
// - Object
// - Any
- /* jshint -W018 */
return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
};
diff --git a/src/deferred.js b/src/deferred.js
index a7938025c..8139515fe 100644
--- a/src/deferred.js
+++ b/src/deferred.js
@@ -37,7 +37,7 @@ function adoptValue( value, resolve, reject ) {
// For Promises/A+, convert exceptions into rejections
// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
// Deferred#then to conditionally suppress rejection.
- } catch ( /*jshint -W002 */ value ) {
+ } catch ( value ) {
// Support: Android 4.0 only
// Strict mode functions invoked without .call/.apply get global-object context
diff --git a/src/effects.js b/src/effects.js
index 6a1fb3a28..cc21cfcfa 100644
--- a/src/effects.js
+++ b/src/effects.js
@@ -51,7 +51,7 @@ function genFx( type, includeWidth ) {
// If we include width, step value is 1 to do all cssExpand values,
// otherwise step value is 2 to skip over Left and Right
includeWidth = includeWidth ? 1 : 0;
- for ( ; i < 4 ; i += 2 - includeWidth ) {
+ for ( ; i < 4; i += 2 - includeWidth ) {
which = cssExpand[ i ];
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
}
@@ -78,7 +78,6 @@ function createTween( value, prop, animation ) {
}
function defaultPrefilter( elem, props, opts ) {
- /* jshint validthis: true */
var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
isBox = "width" in props || "height" in props,
anim = this,
@@ -220,9 +219,12 @@ function defaultPrefilter( elem, props, opts ) {
showHide( [ elem ], true );
}
- /* jshint -W083 */
+ /* eslint-disable no-loop-func */
+
anim.done( function() {
+ /* eslint-enable no-loop-func */
+
// The final step of a "hide" animation is actually hiding the element
if ( !hidden ) {
showHide( [ elem ] );
@@ -307,7 +309,7 @@ function Animation( elem, properties, options ) {
index = 0,
length = animation.tweens.length;
- for ( ; index < length ; index++ ) {
+ for ( ; index < length; index++ ) {
animation.tweens[ index ].run( percent );
}
@@ -348,7 +350,7 @@ function Animation( elem, properties, options ) {
return this;
}
stopped = true;
- for ( ; index < length ; index++ ) {
+ for ( ; index < length; index++ ) {
animation.tweens[ index ].run( 1 );
}
@@ -366,7 +368,7 @@ function Animation( elem, properties, options ) {
propFilter( props, animation.opts.specialEasing );
- for ( ; index < length ; index++ ) {
+ for ( ; index < length; index++ ) {
result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
if ( result ) {
if ( jQuery.isFunction( result.stop ) ) {
@@ -420,7 +422,7 @@ jQuery.Animation = jQuery.extend( Animation, {
index = 0,
length = props.length;
- for ( ; index < length ; index++ ) {
+ for ( ; index < length; index++ ) {
prop = props[ index ];
Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
Animation.tweeners[ prop ].unshift( callback );
diff --git a/src/exports/global.js b/src/exports/global.js
index a50fbb6cd..ebdb73b30 100644
--- a/src/exports/global.js
+++ b/src/exports/global.js
@@ -2,7 +2,7 @@
// This file is included in a different way from all the others
// so the "use strict" pragma is not needed.
-/* jshint strict: false */
+/* eslint strict: "off" */
/* ExcludeEnd */
diff --git a/src/manipulation.js b/src/manipulation.js
index d53eaa021..9b4f5e451 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -29,8 +29,14 @@ define( [
"use strict";
var
+
+ /* eslint-disable max-len */
+
+ // See https://github.com/eslint/eslint/issues/3229
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
+ /* eslint-enable */
+
// Support: IE <=10 - 11, Edge 12 - 13
// In IE/Edge using regex groups here causes severe slowdowns.
// See https://connect.microsoft.com/IE/feedback/details/1736512/
diff --git a/src/selector.js b/src/selector.js
index e13f585ae..2e0c17e15 100644
--- a/src/selector.js
+++ b/src/selector.js
@@ -1 +1,3 @@
-define( [ "./selector-sizzle" ], function() {} );
+define( [ "./selector-sizzle" ], function() {
+ "use strict";
+} );
diff --git a/src/traversing/findFilter.js b/src/traversing/findFilter.js
index 542852475..c742fb5c3 100644
--- a/src/traversing/findFilter.js
+++ b/src/traversing/findFilter.js
@@ -13,7 +13,6 @@ var risSimple = /^.[^:#\[\.,]*$/;
function winnow( elements, qualifier, not ) {
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep( elements, function( elem, i ) {
- /* jshint -W018 */
return !!qualifier.call( elem, i, elem ) !== not;
} );
diff --git a/src/wrapper.js b/src/wrapper.js
index 5f07c059a..d93d036d0 100644
--- a/src/wrapper.js
+++ b/src/wrapper.js
@@ -1,4 +1,4 @@
-/*jshint unused:false */
+/*eslint-disable no-unused-vars*/
/*!
* jQuery JavaScript Library v@VERSION
* https://jquery.com/
@@ -38,7 +38,7 @@
}
// Pass this if window is not defined yet
-}( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
@@ -50,4 +50,4 @@
// build.js inserts compiled jQuery here
return jQuery;
-} ) );
+} );