eslint: Fix warnings

* Load wikimedia/jsduck rules
* Add inline disables for compat
* Fix shadowed variables

Change-Id: I42234ab74f5007c16ff3960309335e715da76c1c
This commit is contained in:
Ed Sanders 2021-02-01 20:55:54 +00:00
parent 025cd0f3ac
commit bb1bd02bd6
5 changed files with 9 additions and 10 deletions

View file

@ -3,15 +3,13 @@
"extends": [
"wikimedia/client",
"wikimedia/jquery",
"wikimedia/mediawiki"
"wikimedia/mediawiki",
"wikimedia/jsduck"
],
"env": {
"commonjs": true
},
"rules": {
"max-len": "off",
"mediawiki/class-doc": "warn",
"no-shadow": "warn",
"compat/compat": "warn"
"max-len": "off"
}
}

View file

@ -65,7 +65,7 @@ module.exports = function ( grunt ) {
} ]
}
},
// eslint-disable-next-line es/no-object-assign
// eslint-disable-next-line es/no-object-assign, compat/compat
banana: Object.assign( {
options: { requireLowerCase: false }
}, conf.MessagesDirs ),

View file

@ -280,6 +280,7 @@ function initDesktop() {
alertController.refreshUnreadCount();
messageController.refreshUnreadCount();
// Make notification update after n*pollingRate(time in secs) where n depends on document.hidden
// eslint-disable-next-line compat/compat
setTimeout( pollForNotificationCountUpdates, ( document.hidden ? 5 : 1 ) * pollingRate * 1000 );
}

View file

@ -124,8 +124,8 @@
// Listen to the event
model
.on( 'discard', function ( group ) {
results.push( group.getName() );
.on( 'discard', function ( g ) {
results.push( g.getName() );
} );
// Fill the list

View file

@ -159,8 +159,8 @@
// Listen to events
model
.on( 'update', function ( items ) {
result.push( 'update:' + items.length );
.on( 'update', function ( itms ) {
result.push( 'update:' + itms.length );
} )
.on( 'discard', function ( item ) {
result.push( 'discard:' + item.getId() );