diff --git a/.eslintrc-browser.json b/.eslintrc-browser.json index 127fc6ce8..372763227 100644 --- a/.eslintrc-browser.json +++ b/.eslintrc-browser.json @@ -19,6 +19,7 @@ }, "rules": { + "one-var": ["error", {"var": "always"}], "strict": ["error", "function"] } } diff --git a/dist/.eslintrc.json b/dist/.eslintrc.json index c2259f149..af08e6812 100644 --- a/dist/.eslintrc.json +++ b/dist/.eslintrc.json @@ -19,7 +19,8 @@ "rules": { // That is okay for the built version - "no-multiple-empty-lines": "off" + "no-multiple-empty-lines": "off", + "one-var": "off" } } ] diff --git a/src/css/support.js b/src/css/support.js index 505adafb6..dc18708c1 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -8,7 +8,7 @@ var reliableTrDimensionsVal; // IE/Edge misreport `getComputedStyle` of table rows with width/height // set in CSS while `offset*` properties report correct values. support.reliableTrDimensions = function() { - var table, tr, trChild; + var table, tr, trChild, trStyle; if ( reliableTrDimensionsVal == null ) { table = document.createElement( "table" ); tr = document.createElement( "tr" ); @@ -23,7 +23,7 @@ support.reliableTrDimensions = function() { .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 a79552c17..f6dd709dc 100644 --- a/src/event.js +++ b/src/event.js @@ -288,11 +288,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 f5a3fa591..f52842efa 100644 --- a/test/.eslintrc.json +++ b/test/.eslintrc.json @@ -47,6 +47,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