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:
committed by
Niklas Laxström
parent
27a8471816
commit
c10140c12b
1411
package-lock.json
generated
1411
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@
|
|||||||
"Siebrand Mazeland"
|
"Siebrand Mazeland"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint-config-wikimedia": "0.20.0",
|
"eslint-config-wikimedia": "0.21.0",
|
||||||
"eslint-plugin-html": "6.1.2",
|
"eslint-plugin-html": "6.1.2",
|
||||||
"grunt": "1.4",
|
"grunt": "1.4",
|
||||||
"grunt-contrib-qunit": "4.0.0",
|
"grunt-contrib-qunit": "4.0.0",
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
var template, ULS;
|
var template, ULS;
|
||||||
|
|
||||||
// Region numbers in id attributes also appear in the langdb.
|
// Region numbers in id attributes also appear in the langdb.
|
||||||
// eslint-disable-next-line no-multi-str
|
|
||||||
template = '<div class="grid uls-menu"> \
|
template = '<div class="grid uls-menu"> \
|
||||||
<div id="search" class="row uls-search"> \
|
<div id="search" class="row uls-search"> \
|
||||||
<div class="uls-search-wrapper"> \
|
<div class="uls-search-wrapper"> \
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
/**
|
/**
|
||||||
* Usage: $( 'inputbox' ).languagefilter();
|
* Usage: $( 'inputbox' ).languagefilter();
|
||||||
* The values for autocompletion is from the options.languages or options.searchAPI.
|
* The values for autocompletion is from the options.languages or options.searchAPI.
|
||||||
|
*
|
||||||
|
* @param {jQuery} $
|
||||||
*/
|
*/
|
||||||
( function ( $ ) {
|
( function ( $ ) {
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -270,12 +272,12 @@
|
|||||||
|
|
||||||
userInput = this.$element.val();
|
userInput = this.$element.val();
|
||||||
suggestion = userInput +
|
suggestion = userInput +
|
||||||
languageName.substring( userInput.length, languageName.length );
|
languageName.slice( userInput.length, languageName.length );
|
||||||
|
|
||||||
if ( suggestion.toLowerCase() !== languageName.toLowerCase() ) {
|
if ( suggestion.toLowerCase() !== languageName.toLowerCase() ) {
|
||||||
// see if it was autonym match
|
// see if it was autonym match
|
||||||
autonym = $.uls.data.getAutonym( langCode ) || '';
|
autonym = $.uls.data.getAutonym( langCode ) || '';
|
||||||
suggestion = userInput + autonym.substring( userInput.length, autonym.length );
|
suggestion = userInput + autonym.slice( userInput.length, autonym.length );
|
||||||
|
|
||||||
if ( suggestion !== autonym ) {
|
if ( suggestion !== autonym ) {
|
||||||
// Give up. It may be an ISO/script code match.
|
// Give up. It may be an ISO/script code match.
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
( function ( $ ) {
|
( function ( $ ) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// eslint-disable-next-line no-multi-str
|
|
||||||
var noResultsTemplate = '<div class="uls-no-results-view"> \
|
var noResultsTemplate = '<div class="uls-no-results-view"> \
|
||||||
<h2 data-i18n="uls-no-results-found" class="uls-no-results-found-title">No results found</h2> \
|
<h2 data-i18n="uls-no-results-found" class="uls-no-results-found-title">No results found</h2> \
|
||||||
<div class="uls-no-results-suggestions"></div> \
|
<div class="uls-no-results-suggestions"></div> \
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
QUnit.module( 'jquery.uls' );
|
QUnit.module( 'jquery.uls' );
|
||||||
|
|
||||||
QUnit.test( '-- Initial check', function ( assert ) {
|
QUnit.test( '-- Initial check', function ( assert ) {
|
||||||
assert.ok( $.fn.uls, '$.fn.uls is defined' );
|
assert.strictEqual( typeof $.fn.uls, 'function', '$.fn.uls is a function' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
}( jQuery ) );
|
}( jQuery ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user