eslint: Drop 'dot-notation' rule
authorEd Sanders <esanders@wikimedia.org>
Tue, 27 Nov 2018 22:36:25 +0000 (22:36 +0000)
committerEd Sanders <esanders@wikimedia.org>
Tue, 27 Nov 2018 22:36:25 +0000 (22:36 +0000)
Bug: T210552
Change-Id: I07620ed2e3a1acfd3193e411c8369722ae751ffa

.eslintrc.json
resources/src/mediawiki.debug/debug.js
resources/src/mediawiki.special.apisandbox/apisandbox.js
resources/src/mediawiki.widgets.datetime/CalendarWidget.js
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js
resources/src/mediawiki.widgets.datetime/DiscordianDateTimeFormatter.js
resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js
tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js

index 99d7730..97f7c31 100644 (file)
@@ -10,7 +10,6 @@
                "OO": false
        },
        "rules": {
-               "dot-notation": 0,
                "max-len": 0
        }
 }
index f1e829c..32dbdc1 100644 (file)
                                        .append( $( '<td>' ).text( i + 1 ) )
                                        .append( $( '<td>' ).text( query.sql ) )
                                        .append( $( '<td>' ).text( ( query.time * 1000 ).toFixed( 4 ) + 'ms' ).addClass( 'stats' ) )
-                                       .append( $( '<td>' ).text( query[ 'function' ] ) )
+                                       .append( $( '<td>' ).text( query.function ) )
                                        .appendTo( $table );
                        }
 
index 52bcd30..3762ae7 100644 (file)
@@ -33,7 +33,7 @@
                this.checkbox = new OO.ui.CheckboxInputWidget( config.checkbox )
                        .on( 'change', this.onCheckboxChange, [], this );
 
-               OptionalWidget[ 'super' ].call( this, config );
+               OptionalWidget.super.call( this, config );
 
                // Forward most methods for convenience
                for ( k in this.widget ) {
@@ -75,7 +75,7 @@
                }
        };
        OptionalWidget.prototype.setDisabled = function ( disabled ) {
-               OptionalWidget[ 'super' ].prototype.setDisabled.call( this, disabled );
+               OptionalWidget.super.prototype.setDisabled.call( this, disabled );
                this.widget.setDisabled( this.isDisabled() );
                this.checkbox.setSelected( !this.isDisabled() );
                this.$cover.toggle( this.isDisabled() );
@@ -90,7 +90,7 @@
                        },
                        setApiValue: function ( v ) {
                                if ( v === undefined ) {
-                                       v = this.paramInfo[ 'default' ];
+                                       v = this.paramInfo.default;
                                }
                                this.setValue( v );
                        },
                                var menu = this.getMenu();
 
                                if ( v === undefined ) {
-                                       v = this.paramInfo[ 'default' ];
+                                       v = this.paramInfo.default;
                                }
                                if ( v === undefined ) {
                                        menu.selectItem();
                                }
                        },
                        getApiValueForTemplates: function () {
-                               return this.isDisabled() ? this.parseApiValue( this.paramInfo[ 'default' ] ) : this.getValue();
+                               return this.isDisabled() ? this.parseApiValue( this.paramInfo.default ) : this.getValue();
                        },
                        getApiValue: function () {
                                var items = this.getValue();
                        },
                        setApiValue: function ( v ) {
                                if ( v === undefined ) {
-                                       v = this.paramInfo[ 'default' ];
+                                       v = this.paramInfo.default;
                                }
                                this.setValue( this.parseApiValue( v ) );
                        },
 
                submoduleWidget: {
                        single: function () {
-                               var v = this.isDisabled() ? this.paramInfo[ 'default' ] : this.getApiValue();
+                               var v = this.isDisabled() ? this.paramInfo.default : this.getApiValue();
                                return v === undefined ? [] : [ { value: v, path: this.paramInfo.submodules[ v ] } ];
                        },
                        multi: function () {
                                var map = this.paramInfo.submodules,
-                                       v = this.isDisabled() ? this.paramInfo[ 'default' ] : this.getApiValue();
+                                       v = this.isDisabled() ? this.paramInfo.default : this.getApiValue();
                                return v === undefined || v === '' ? [] : String( v ).split( '|' ).map( function ( v ) {
                                        return { value: v, path: map[ v ] };
                                } );
                                finalWidget.setDisabled( true );
                        }
 
-                       widget.setApiValue( pi[ 'default' ] );
+                       widget.setApiValue( pi.default );
 
                        return finalWidget;
                },
                                                                .text( data )
                                                                .appendTo( $result );
                                                }
-                                               if ( paramsAreForced || data[ 'continue' ] ) {
+                                               if ( paramsAreForced || data.continue ) {
                                                        $result.append(
                                                                $( '<div>' ).append(
                                                                        new OO.ui.ButtonWidget( {
                                                                                label: mw.message( 'apisandbox-continue' ).text()
                                                                        } ).on( 'click', function () {
-                                                                               ApiSandbox.sendRequest( $.extend( {}, baseRequestParams, data[ 'continue' ] ) );
-                                                                       } ).setDisabled( !data[ 'continue' ] ).$element,
+                                                                               ApiSandbox.sendRequest( $.extend( {}, baseRequestParams, data.continue ) );
+                                                                       } ).setDisabled( !data.continue ).$element,
                                                                        ( clear = new OO.ui.ButtonWidget( {
                                                                                label: mw.message( 'apisandbox-continue-clear' ).text()
                                                                        } ).on( 'click', function () {
                this.templatedItemsCache = {};
                this.tokenWidget = null;
                this.indentLevel = config.indentLevel ? config.indentLevel : 0;
-               ApiSandbox.PageLayout[ 'super' ].call( this, config.key, config );
+               ApiSandbox.PageLayout.super.call( this, config.key, config );
                this.loadParamInfo();
        };
        OO.inheritClass( ApiSandbox.PageLayout, OO.ui.PageLayout );
                                        for ( i = 0; i < pi.parameters.length; i++ ) {
                                                if ( pi.parameters[ i ].name === 'action' ) {
                                                        pi.parameters[ i ].required = true;
-                                                       delete pi.parameters[ i ][ 'default' ];
+                                                       delete pi.parameters[ i ].default;
                                                }
                                                if ( pi.parameters[ i ].name === 'format' ) {
                                                        tmp = pi.parameters[ i ].type;
                                                                availableFormats[ tmp[ j ] ] = true;
                                                        }
                                                        pi.parameters[ i ].type = tmp.filter( filterFmModules );
-                                                       pi.parameters[ i ][ 'default' ] = 'json';
+                                                       pi.parameters[ i ].default = 'json';
                                                        pi.parameters[ i ].required = true;
                                                }
                                        }
index 0d664e4..3ad6e29 100644 (file)
@@ -40,7 +40,7 @@
                }, config );
 
                // Parent constructor
-               mw.widgets.datetime.CalendarWidget[ 'super' ].call( this, config );
+               mw.widgets.datetime.CalendarWidget.super.call( this, config );
 
                // Mixin constructors
                OO.ui.mixin.TabIndexedElement.call( this, $.extend( {}, config, { $tabIndexed: this.$element } ) );
                change = visible !== this.isVisible();
 
                // Parent method
-               mw.widgets.datetime.CalendarWidget[ 'super' ].prototype.toggle.call( this, visible );
+               mw.widgets.datetime.CalendarWidget.super.prototype.toggle.call( this, visible );
 
                if ( change ) {
                        if ( visible ) {
index db9b7d6..ef7cea9 100644 (file)
@@ -64,7 +64,7 @@
                this.type = config.type;
 
                // Parent constructor
-               mw.widgets.datetime.DateTimeInputWidget[ 'super' ].call( this, config );
+               mw.widgets.datetime.DateTimeInputWidget.super.call( this, config );
 
                // Mixin constructors
                OO.ui.mixin.IconElement.call( this, config );
         * @inheritdoc
         */
        mw.widgets.datetime.DateTimeInputWidget.prototype.setDisabled = function ( disabled ) {
-               mw.widgets.datetime.DateTimeInputWidget[ 'super' ].prototype.setDisabled.call( this, disabled );
+               mw.widgets.datetime.DateTimeInputWidget.super.prototype.setDisabled.call( this, disabled );
 
                // Flag all our fields as disabled
                if ( this.$fields ) {
index 6635576..c64a550 100644 (file)
@@ -20,7 +20,7 @@
                config = $.extend( {}, config );
 
                // Parent constructor
-               mw.widgets.datetime.DiscordianDateTimeFormatter[ 'super' ].call( this, config );
+               mw.widgets.datetime.DiscordianDateTimeFormatter.super.call( this, config );
        };
 
        /* Setup */
                                break;
 
                        default:
-                               return mw.widgets.datetime.DiscordianDateTimeFormatter[ 'super' ].prototype.getFieldForTag.call( this, tag, params );
+                               return mw.widgets.datetime.DiscordianDateTimeFormatter.super.prototype.getFieldForTag.call( this, tag, params );
                }
 
                if ( spec ) {
index aaf8817..06dd2d5 100644 (file)
@@ -70,7 +70,7 @@
                }, config );
 
                // Parent constructor
-               mw.widgets.datetime.ProlepticGregorianDateTimeFormatter[ 'super' ].call( this, config );
+               mw.widgets.datetime.ProlepticGregorianDateTimeFormatter.super.call( this, config );
 
                // Properties
                this.weekStartsOn = config.weekStartsOn % 7;
                                break;
 
                        default:
-                               return mw.widgets.datetime.ProlepticGregorianDateTimeFormatter[ 'super' ].prototype.getFieldForTag.call( this, tag, params );
+                               return mw.widgets.datetime.ProlepticGregorianDateTimeFormatter.super.prototype.getFieldForTag.call( this, tag, params );
                }
 
                if ( spec ) {
index 347614c..1118279 100644 (file)
                        assert.strictEqual( siteFromUser, 1, 'site ran before user' );
                } ).always( function () {
                        // Reset
-                       mw.loader.moduleRegistry[ 'site' ].state = 'registered';
-                       mw.loader.moduleRegistry[ 'user' ].state = 'registered';
+                       mw.loader.moduleRegistry.site.state = 'registered';
+                       mw.loader.moduleRegistry.user.state = 'registered';
                } );
        } );