Update eslint-config-wikimedia to 0.9.0

Change-Id: I7883af1f56c7f2f3eeff1f7a51b640a303bcab78
This commit is contained in:
Ed Sanders 2018-11-27 22:23:57 +00:00
parent 8991801975
commit fdde5b71af
5 changed files with 40 additions and 35 deletions

View file

@ -1,11 +1,10 @@
{
"extends": "wikimedia",
"env": {
"browser": true
},
"extends": [
"wikimedia/client",
"wikimedia/jquery"
],
"globals": {
"mw": false,
"$": false
"mw": false
},
"rules": {
"dot-notation": [ "error", { "allowKeywords": true } ],

View file

@ -146,16 +146,19 @@ ve.ui.MWCitationDialog.prototype.onAddParameterBeforeLoad = function ( page ) {
* @return {boolean}
*/
ve.ui.MWCitationDialog.prototype.hasUsefulParameter = function () {
var foundUseful = false;
$.each( this.bookletLayout.pages, function () {
var name, page,
foundUseful = false;
for ( name in this.bookletLayout.pages ) {
page = this.bookletLayout.pages[ name ];
if (
this instanceof ve.ui.MWParameterPage &&
( !this.preLoad || this.valueInput.getValue() !== '' )
page instanceof ve.ui.MWParameterPage &&
( !page.preLoad || page.valueInput.getValue() !== '' )
) {
foundUseful = true;
return false;
}
} );
}
return foundUseful;
};

View file

@ -44,17 +44,20 @@ ve.ui.MWReferenceGroupInputWidget.prototype.populateMenu = function ( internalLi
flags: 'emptyGroupPlaceholder'
} );
this.menu.clearItems();
this.menu.addItems( [ placeholderGroupItem ].concat( $.map(
Object.keys( internalList.getNodeGroups() ),
function ( groupInternalName ) {
var groupName;
if ( groupInternalName.indexOf( 'mwReference/' ) === 0 ) {
groupName = groupInternalName.slice( 'mwReference/'.length );
if ( groupName ) {
return new OO.ui.MenuOptionWidget( { data: groupName, label: groupName } );
this.menu.addItems( [ placeholderGroupItem ].concat(
Object.keys( internalList.getNodeGroups() ).map(
function ( groupInternalName ) {
var groupName;
if ( groupInternalName.indexOf( 'mwReference/' ) === 0 ) {
groupName = groupInternalName.slice( 'mwReference/'.length );
if ( groupName ) {
return new OO.ui.MenuOptionWidget( { data: groupName, label: groupName } );
}
}
}
}
) ), 0 );
).filter( function ( item ) {
return item;
} )
), 0 );
this.menu.toggle( false );
};

View file

@ -8,8 +8,7 @@
"selenium-test": "wdio tests/selenium/wdio.conf.js"
},
"devDependencies": {
"eslint-config-wikimedia": "0.8.1",
"eslint-plugin-qunit": "3.3.1",
"eslint-config-wikimedia": "0.9.0",
"grunt": "1.0.3",
"grunt-banana-checker": "0.6.0",
"grunt-eslint": "21.0.0",

View file

@ -1,14 +1,15 @@
{
"extends": "wikimedia",
"env": {
"es6": true,
"mocha": true,
"node": true
},
"globals": {
"browser": false
},
"rules": {
"no-console": 0
}
"root": true,
"extends": [
"wikimedia/server"
],
"env": {
"mocha": true
},
"globals": {
"browser": false
},
"rules": {
"no-console": 0
}
}