diff --git a/.eslintrc-browser.json b/.eslintrc-browser.json index ffd5b6467..d580883b2 100644 --- a/.eslintrc-browser.json +++ b/.eslintrc-browser.json @@ -24,6 +24,7 @@ }, "rules": { + "one-var": ["error", {"var": "always"}], "strict": ["error", "function"] } } diff --git a/dist/.eslintrc.json b/dist/.eslintrc.json index ff02f72bc..a86695799 100644 --- a/dist/.eslintrc.json +++ b/dist/.eslintrc.json @@ -14,6 +14,7 @@ "rules": { // That is okay for the built version "no-multiple-empty-lines": "off", + "one-var": "off", // Sizzle is not compatible with jQuery code style "no-nested-ternary": "off", diff --git a/src/css/support.js b/src/css/support.js index 6d9561def..fb2a1b204 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -103,7 +103,7 @@ define( [ // Behavior in IE 9 is more subtle than in newer versions & it passes // some versions of this test; make sure not to make it pass there! reliableTrDimensions: function() { - var table, tr, trChild; + var table, tr, trChild, trStyle; if ( reliableTrDimensionsVal == null ) { table = document.createElement( "table" ); tr = document.createElement( "tr" ); @@ -118,7 +118,7 @@ define( [ .appendChild( tr ) .appendChild( trChild ); - var trStyle = window.getComputedStyle( tr ); + trStyle = window.getComputedStyle( tr ); reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; documentElement.removeChild( table ); diff --git a/src/event.js b/src/event.js index 79abf5614..734f6f020 100644 --- a/src/event.js +++ b/src/event.js @@ -308,11 +308,12 @@ jQuery.event = { dispatch: function( nativeEvent ) { - // Make a writable jQuery.Event from the native event object - var event = jQuery.event.fix( nativeEvent ); - var i, j, ret, matched, handleObj, handlerQueue, args = new Array( arguments.length ), + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; diff --git a/test/.eslintrc.json b/test/.eslintrc.json index a23ea5f98..4d85386e6 100644 --- a/test/.eslintrc.json +++ b/test/.eslintrc.json @@ -46,6 +46,7 @@ "brace-style": "off", "key-spacing": "off", "camelcase": "off", + "one-var": "off", "strict": "off", // Not really too many - waiting for autofix features for these rules