From 4a7fc8544e2020c75047456d11979e4e3a517fdf Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski-Owczarek Date: Mon, 2 Mar 2020 22:25:35 +0100 Subject: Build: Enable ESLint one-var rule for var declarations in browser code Node.js code is written more & more commonly in ES6+ so it doesn't make sense to enable it there. There are many violations in test code so it's disabled there as well. Closes gh-4615 --- src/css/support.js | 4 ++-- src/event.js | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') 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 ] || {}; -- cgit v1.2.3