Upgrade eslint-config-wikimedia to 0.21.0

JavaScript code and comments changes:
* Remove no-multi-str disabling.
* Document $ parameter.
* Replace .substring() with .slice().
* Change assert.ok() to assert.strictEqual() in a test.
This commit is contained in:
Amir E. Aharoni
2022-01-28 13:42:19 +02:00
committed by Niklas Laxström
parent 27a8471816
commit c10140c12b
6 changed files with 1110 additions and 313 deletions

View File

@@ -19,6 +19,8 @@
/**
* Usage: $( 'inputbox' ).languagefilter();
* The values for autocompletion is from the options.languages or options.searchAPI.
*
* @param {jQuery} $
*/
( function ( $ ) {
'use strict';
@@ -270,12 +272,12 @@
userInput = this.$element.val();
suggestion = userInput +
languageName.substring( userInput.length, languageName.length );
languageName.slice( userInput.length, languageName.length );
if ( suggestion.toLowerCase() !== languageName.toLowerCase() ) {
// see if it was autonym match
autonym = $.uls.data.getAutonym( langCode ) || '';
suggestion = userInput + autonym.substring( userInput.length, autonym.length );
suggestion = userInput + autonym.slice( userInput.length, autonym.length );
if ( suggestion !== autonym ) {
// Give up. It may be an ISO/script code match.