mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-13 17:52:33 +00:00
eslint: Enforce prefer-const
Change-Id: I505dca84d0e864a4ac96c71747f08a062ddc1865
This commit is contained in:
parent
8f75c66cb0
commit
cceb09abe8
|
@ -6,9 +6,7 @@
|
|||
"wikimedia/mediawiki"
|
||||
],
|
||||
"rules": {
|
||||
"no-var": "warn",
|
||||
"max-len": "off",
|
||||
"no-jquery/no-global-selector": "off",
|
||||
"prefer-const": "warn"
|
||||
"no-jquery/no-global-selector": "off"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,12 +43,11 @@
|
|||
* @see jQuery#findWithParent
|
||||
*/
|
||||
$.fn.findWithParent = function ( selector ) {
|
||||
let selectors = selector.split( ',' ),
|
||||
$elements = $(),
|
||||
self = this;
|
||||
const selectors = selector.split( ',' );
|
||||
let $elements = $();
|
||||
|
||||
selectors.forEach( ( sel ) => {
|
||||
$elements = $elements.add( jQueryFindWithParent( self, sel ) );
|
||||
$elements = $elements.add( jQueryFindWithParent( this, sel ) );
|
||||
} );
|
||||
|
||||
return $elements;
|
||||
|
|
Loading…
Reference in a new issue