build: Update eslint-config-wikimedia to 0.10.1
authorEd Sanders <esanders@wikimedia.org>
Sat, 2 Feb 2019 19:05:04 +0000 (11:05 -0800)
committerEd Sanders <esanders@wikimedia.org>
Sat, 2 Feb 2019 19:05:04 +0000 (11:05 -0800)
Change-Id: Id98af16c1ec1c6c4a790948a35e96e2fe925ebb5

package.json
resources/src/jquery/jquery.makeCollapsible.js
resources/src/jquery/jquery.suggestions.js
resources/src/mediawiki.inspect.js
resources/src/mediawiki.notification/notification.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
resources/src/mediawiki.special.apisandbox/apisandbox.js
resources/src/mediawiki.special.userrights.js

index c0570cf..5b65a09 100644 (file)
@@ -10,7 +10,7 @@
     "selenium-test": "wdio ./tests/selenium/wdio.conf.js"
   },
   "devDependencies": {
-    "eslint-config-wikimedia": "0.10.0",
+    "eslint-config-wikimedia": "0.10.1",
     "grunt": "1.0.3",
     "grunt-banana-checker": "0.6.0",
     "grunt-contrib-copy": "1.0.0",
index f5f0475..09306f6 100644 (file)
@@ -82,7 +82,6 @@
                        }
                }
 
-               // eslint-disable-next-line jquery/no-animate-toggle
                $containers.toggle( action === 'expand' );
                hookCallback();
        }
index 01d2ba5..d9a094c 100644 (file)
                                // Only fetch if the value in the textbox changed and is not empty, or if the results were hidden
                                // if the textbox is empty then clear the result div, but leave other settings intouched
                                if ( val.length === 0 ) {
-                                       // eslint-disable-next-line jquery/no-animate-toggle
                                        $.suggestions.hide( context );
                                        context.data.prevText = '';
                                } else if (
                                        if ( context.data !== undefined ) {
                                                if ( context.data.$textbox.val().length === 0 ) {
                                                        // Hide the div when no suggestion exist
-                                                       // eslint-disable-next-line jquery/no-animate-toggle
                                                        $.suggestions.hide( context );
                                                } else {
                                                        // Rebuild the suggestions list
                                        break;
                                // Escape
                                case 27:
-                                       // eslint-disable-next-line jquery/no-animate-toggle
                                        $.suggestions.hide( context );
                                        $.suggestions.restore( context );
                                        $.suggestions.cancel( context );
                                case 13:
                                        preventDefault = wasVisible;
                                        selected = context.data.$container.find( '.suggestions-result-current' );
-                                       // eslint-disable-next-line jquery/no-animate-toggle
                                        $.suggestions.hide( context );
                                        if ( selected.length === 0 || context.data.selectedWithMouse ) {
                                                // If nothing is selected or if something was selected with the mouse
                                                                        // This will hide the link we're just clicking on, which causes problems
                                                                        // when done synchronously in at least Firefox 3.6 (T64858).
                                                                        setTimeout( function () {
-                                                                               // eslint-disable-next-line jquery/no-animate-toggle
                                                                                $.suggestions.hide( context );
                                                                        } );
                                                                }
                                                                        // This will hide the link we're just clicking on, which causes problems
                                                                        // when done synchronously in at least Firefox 3.6 (T64858).
                                                                        setTimeout( function () {
-                                                                               // eslint-disable-next-line jquery/no-animate-toggle
                                                                                $.suggestions.hide( context );
                                                                        } );
                                                                }
                                        } )
                                        .on( 'keypress', function ( e ) {
                                                context.data.keypressedCount++;
-                                               // eslint-disable-next-line jquery/no-event-shorthand
                                                $.suggestions.keypress( e, context, context.data.keypressed );
                                        } )
                                        .on( 'keyup', function ( e ) {
                                                        e.which === context.data.keypressed &&
                                                        allowed.indexOf( e.which ) !== -1
                                                ) {
-                                                       // eslint-disable-next-line jquery/no-event-shorthand
                                                        $.suggestions.keypress( e, context, context.data.keypressed );
                                                }
                                        } )
                                                if ( context.data.mouseDownOn.length > 0 ) {
                                                        return;
                                                }
-                                               // eslint-disable-next-line jquery/no-animate-toggle
                                                $.suggestions.hide( context );
                                                $.suggestions.cancel( context );
                                        } );
index 72a27fa..849ccbc 100644 (file)
                } );
        }
 
-       function humanSize( bytes ) {
+       function humanSize( bytesInput ) {
                var i,
+                       bytes = +bytesInput,
                        units = [ '', ' KiB', ' MiB', ' GiB', ' TiB', ' PiB' ];
 
-               if ( !$.isNumeric( bytes ) || bytes === 0 ) {
-                       return bytes;
+               if ( bytes === 0 || isNaN( bytes ) ) {
+                       return bytesInput;
                }
 
                for ( i = 0; bytes >= 1024; bytes /= 1024 ) {
index 2765d07..e8450df 100644 (file)
                                        $area.css( 'display', 'none' );
                                        notif.$notification.remove();
                                } else {
+                                       // FIXME: Use CSS transition
+                                       // eslint-disable-next-line jquery/no-slide
                                        notif.$notification.slideUp( 'fast', function () {
                                                $( this ).remove();
                                        } );
index 1651432..6eb8867 100644 (file)
                                        title: '', // Because it's a hidden group, this title actually appears nowhere
                                        hidden: true,
                                        allowArbitrary: true,
+                                       // FIXME: $.isNumeric is deprecated
                                        validate: $.isNumeric,
                                        range: {
                                                min: 0, // The server normalizes negative numbers to 0 results
                                        title: '', // Because it's a hidden group, this title actually appears nowhere
                                        hidden: true,
                                        allowArbitrary: true,
+                                       // FIXME: $.isNumeric is deprecated
                                        validate: $.isNumeric,
                                        range: {
                                                min: 0,
         * @param {number|string} newValue New value
         */
        mw.rcfilters.Controller.prototype.updateNumericPreference = function ( prefName, newValue ) {
+               // FIXME: $.isNumeric is deprecated
+               // eslint-disable-next-line jquery/no-is-numeric
                if ( !$.isNumeric( newValue ) ) {
                        return;
                }
index 19eac98..68c7ddc 100644 (file)
                        // OO.ui.ButtonWidget doesn't take focus itself (T128054)
                        $focus = $( '#mw-apisandbox-ui' ).find( document.activeElement );
                        if ( $focus.length ) {
-                               // eslint-disable-next-line jquery/no-event-shorthand
                                $focus[ 0 ].blur();
                        }
 
                                }
 
                                that.deprecatedItemsFieldset = new OO.ui.FieldsetLayout().addItems( deprecatedItems ).toggle( false );
-                               // eslint-disable-next-line jquery/no-animate-toggle
                                tmp = $( '<fieldset>' )
                                        .toggle( !that.deprecatedItemsFieldset.isEmpty() )
                                        .append(
index 63d9623..a4f5d1a 100644 (file)
@@ -12,7 +12,6 @@
 
        // Dynamically show/hide the "other time" input under each dropdown
        $( '.mw-userrights-nested select' ).on( 'change', function ( e ) {
-               // eslint-disable-next-line jquery/no-animate-toggle
                $( e.target.parentNode ).find( 'input' ).toggle( $( e.target ).val() === 'other' );
        } );