build: Update eslint-config-wikimedia to 0.11.0

Change-Id: Ic59891fab5f8e35420bddbed34072841883fa543
This commit is contained in:
Ed Sanders
2019-03-13 23:40:01 +00:00
parent 595693a3f5
commit c080452013
11 changed files with 29 additions and 20 deletions

View File

@@ -10,5 +10,8 @@
"globals": {
"mw": false,
"OO": false
},
"rules": {
"no-jquery/no-global-selector": "off"
}
}

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@
node_modules/
composer.lock
vendor/
.eslintcache

View File

@@ -10,6 +10,10 @@ module.exports = function ( grunt ) {
grunt.initConfig( {
eslint: {
options: {
reportUnusedDisableDirectives: true,
cache: true
},
all: '.'
},
stylelint: {

View File

@@ -4,9 +4,9 @@
"test": "grunt test"
},
"devDependencies": {
"eslint-config-wikimedia": "0.9.0",
"eslint-config-wikimedia": "0.11.0",
"grunt": "1.0.3",
"grunt-banana-checker": "0.6.0",
"grunt-banana-checker": "0.7.0",
"grunt-eslint": "21.0.0",
"grunt-jsonlint": "1.1.0",
"grunt-stylelint": "0.10.1",

View File

@@ -317,7 +317,7 @@
// Load the ULS now.
mw.loader.using( 'ext.uls.mediawiki' ).then( function () {
self.createSelector( self.$trigger );
self.$trigger.click();
self.$trigger.trigger( 'click' );
} );
} );
};

View File

@@ -185,7 +185,7 @@
var deferred = new $.Deferred();
$loginCta.html( parsedCta ); // The parsed CTA is HTML
$loginCta.find( 'a' ).click( function ( event ) {
$loginCta.find( 'a' ).on( 'click', function ( event ) {
event.preventDefault();
// Because browsers navigate away when clicking a link,
// we are overriding the normal click behavior to allow
@@ -301,7 +301,7 @@
$back = $( '<div>' )
.addClass( 'uls-icon-back' );
$back.click( function () {
$back.on( 'click', function () {
uls.hide();
displaySettings.$parent.show();
} );

View File

@@ -150,7 +150,7 @@
defaultModule: 'input',
onClose: function () {
// on close of input settings, keep focus in input area.
imeselector.$element.focus();
imeselector.$element.trigger( 'focus' );
},
top: imeselector.$element.offset().top
} );
@@ -291,7 +291,7 @@
$ulsTrigger.uls( {
onSelect: function ( language ) {
$input.data( 'imeselector' ).selectLanguage( language );
$input.focus();
$input.trigger( 'focus' );
},
languages: mw.ime.getLanguagesWithIME(),
ulsPurpose: 'ime-selector',
@@ -308,7 +308,7 @@
title: $.i18n( 'ext-uls-ime-help' )
} )
.addClass( 'ime-perime-help' )
.click( function ( event ) {
.on( 'click', function ( event ) {
event.stopPropagation();
} );
}

View File

@@ -173,7 +173,8 @@
$imeLabel = $( '<label>' ).attr( 'for', imeId );
$inputMethodItem = $( '<input type="radio">' ).attr( {
$inputMethodItem = $( '<input>' ).attr( {
type: 'radio',
name: 'ime',
id: imeId,
value: imeId
@@ -306,7 +307,7 @@
$button.on( 'click', buttonHandler( $button ) );
if ( language === selectedImeLanguage ) {
$button.click();
$button.trigger( 'click' );
}
}
@@ -339,7 +340,7 @@
.i18n()
.text( ' ' );
$back.click( function () {
$back.on( 'click', function () {
uls.hide();
inputSettings.$parent.show();
} );

View File

@@ -79,7 +79,7 @@
};
}
$.extend( displaySettingsOptions, uls.position() );
$displaySettings.languagesettings( displaySettingsOptions ).click();
$displaySettings.languagesettings( displaySettingsOptions ).trigger( 'click' );
} );
}
@@ -104,7 +104,7 @@
},
top: position.top,
left: position.left
} ).click();
} ).trigger( 'click' );
} );
}
@@ -182,7 +182,7 @@
.text( previousAutonym )
.prop( {
href: '',
'class': 'uls-prevlang-link',
class: 'uls-prevlang-link',
lang: previousLang,
// We could get dir from uls.data,
// but we are trying to avoid loading it
@@ -311,7 +311,7 @@
};
mw.loader.using( mw.uls.languageSettingsModules, function () {
$ulsTrigger.languagesettings( languageSettingsOptions ).click();
$ulsTrigger.languagesettings( languageSettingsOptions ).trigger( 'click' );
} );
e.stopPropagation();

View File

@@ -81,7 +81,7 @@
this.$window.find( 'button.uls-settings-apply' )
.on( 'click', mw.hook( 'mw.uls.settings.apply' ).fire.bind( this ) );
// Hide the window when clicked outside
$( 'html' ).click( this.hide.bind( this ) );
$( 'html' ).on( 'click', this.hide.bind( this ) );
// ... but when clicked on window do not hide.
this.$window.on( 'click', function ( event ) {
@@ -189,18 +189,18 @@
this.initialized = true;
}
// Close other modal windows which listen to click events outside them
$( 'html' ).click();
$( 'html' ).trigger( 'click' );
this.i18n();
// Every time we show this window, make sure the current
// settings panels is up-to-date. So just click on active menu item.
this.$window.find( '.settings-menu-items > .active' ).click();
this.$window.find( '.settings-menu-items > .active' ).trigger( 'click' );
this.shown = true;
this.$window.show();
this.visible();
this.$window.scrollIntoView();
// For keyboard navigation, put the focus on an element inside the dialog
this.$window.find( '.menu-section.active' ).focus();
this.$window.find( '.menu-section.active' ).trigger( 'focus' );
},
/**

View File

@@ -126,7 +126,7 @@
save: function ( callback ) {
var ulsPreferences = this;
callback = callback || $.noop;
callback = callback || function () {};
if ( this.isAnon ) {
// Anonymous user. Save preferences in local storage
preferenceStore().set( this.preferenceName, this.preferences );