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": { "globals": {
"mw": false, "mw": false,
"OO": false "OO": false
},
"rules": {
"no-jquery/no-global-selector": "off"
} }
} }

1
.gitignore vendored
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -81,7 +81,7 @@
this.$window.find( 'button.uls-settings-apply' ) this.$window.find( 'button.uls-settings-apply' )
.on( 'click', mw.hook( 'mw.uls.settings.apply' ).fire.bind( this ) ); .on( 'click', mw.hook( 'mw.uls.settings.apply' ).fire.bind( this ) );
// Hide the window when clicked outside // 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. // ... but when clicked on window do not hide.
this.$window.on( 'click', function ( event ) { this.$window.on( 'click', function ( event ) {
@@ -189,18 +189,18 @@
this.initialized = true; this.initialized = true;
} }
// Close other modal windows which listen to click events outside them // Close other modal windows which listen to click events outside them
$( 'html' ).click(); $( 'html' ).trigger( 'click' );
this.i18n(); this.i18n();
// Every time we show this window, make sure the current // Every time we show this window, make sure the current
// settings panels is up-to-date. So just click on active menu item. // 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.shown = true;
this.$window.show(); this.$window.show();
this.visible(); this.visible();
this.$window.scrollIntoView(); this.$window.scrollIntoView();
// For keyboard navigation, put the focus on an element inside the dialog // 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 ) { save: function ( callback ) {
var ulsPreferences = this; var ulsPreferences = this;
callback = callback || $.noop; callback = callback || function () {};
if ( this.isAnon ) { if ( this.isAnon ) {
// Anonymous user. Save preferences in local storage // Anonymous user. Save preferences in local storage
preferenceStore().set( this.preferenceName, this.preferences ); preferenceStore().set( this.preferenceName, this.preferences );