mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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
This commit is contained in:
parent
364476c3dc
commit
4a7fc8544e
@ -19,6 +19,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"one-var": ["error", {"var": "always"}],
|
||||||
"strict": ["error", "function"]
|
"strict": ["error", "function"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
dist/.eslintrc.json
vendored
3
dist/.eslintrc.json
vendored
@ -19,7 +19,8 @@
|
|||||||
|
|
||||||
"rules": {
|
"rules": {
|
||||||
// That is okay for the built version
|
// That is okay for the built version
|
||||||
"no-multiple-empty-lines": "off"
|
"no-multiple-empty-lines": "off",
|
||||||
|
"one-var": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -8,7 +8,7 @@ var reliableTrDimensionsVal;
|
|||||||
// IE/Edge misreport `getComputedStyle` of table rows with width/height
|
// IE/Edge misreport `getComputedStyle` of table rows with width/height
|
||||||
// set in CSS while `offset*` properties report correct values.
|
// set in CSS while `offset*` properties report correct values.
|
||||||
support.reliableTrDimensions = function() {
|
support.reliableTrDimensions = function() {
|
||||||
var table, tr, trChild;
|
var table, tr, trChild, trStyle;
|
||||||
if ( reliableTrDimensionsVal == null ) {
|
if ( reliableTrDimensionsVal == null ) {
|
||||||
table = document.createElement( "table" );
|
table = document.createElement( "table" );
|
||||||
tr = document.createElement( "tr" );
|
tr = document.createElement( "tr" );
|
||||||
@ -23,7 +23,7 @@ support.reliableTrDimensions = function() {
|
|||||||
.appendChild( tr )
|
.appendChild( tr )
|
||||||
.appendChild( trChild );
|
.appendChild( trChild );
|
||||||
|
|
||||||
var trStyle = window.getComputedStyle( tr );
|
trStyle = window.getComputedStyle( tr );
|
||||||
reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
|
reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
|
||||||
|
|
||||||
documentElement.removeChild( table );
|
documentElement.removeChild( table );
|
||||||
|
@ -288,11 +288,12 @@ jQuery.event = {
|
|||||||
|
|
||||||
dispatch: function( nativeEvent ) {
|
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,
|
var i, j, ret, matched, handleObj, handlerQueue,
|
||||||
args = new Array( arguments.length ),
|
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 ] || [],
|
handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
|
||||||
special = jQuery.event.special[ event.type ] || {};
|
special = jQuery.event.special[ event.type ] || {};
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
"brace-style": "off",
|
"brace-style": "off",
|
||||||
"key-spacing": "off",
|
"key-spacing": "off",
|
||||||
"camelcase": "off",
|
"camelcase": "off",
|
||||||
|
"one-var": "off",
|
||||||
"strict": "off",
|
"strict": "off",
|
||||||
|
|
||||||
// Not really too many - waiting for autofix features for these rules
|
// Not really too many - waiting for autofix features for these rules
|
||||||
|
Loading…
Reference in New Issue
Block a user