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