build: Use eslint-config-wikimedia v0.9.0 and make pass
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / mw.rcfilters.Controller.js
index 5af001e..e84e396 100644 (file)
@@ -1,4 +1,5 @@
-( function ( mw, $ ) {
+/* eslint-disable no-restricted-properties */
+( function () {
 
        var byteLength = require( 'mediawiki.String' ).byteLength;
 
@@ -67,6 +68,7 @@
                // Prepare views
                if ( namespaceStructure ) {
                        items = [];
+                       // eslint-disable-next-line jquery/no-each-util
                        $.each( namespaceStructure, function ( namespaceID, label ) {
                                // Build and clean up the individual namespace items definition
                                items.push( {
@@ -74,8 +76,8 @@
                                        label: label || mw.msg( 'blanknamespace' ),
                                        description: '',
                                        identifiers: [
-                                               ( namespaceID < 0 || namespaceID % 2 === 0 ) ?
-                                                       'subject' : 'talk'
+                                               mw.Title.isTalkNamespace( namespaceID ) ?
+                                                       'talk' : 'subject'
                                        ],
                                        cssClass: 'mw-changeslist-ns-' + namespaceID
                                } );
                // Before we do anything, we need to see if we require additional items in the
                // groups that have 'AllowArbitrary'. For the moment, those are only single_option
                // groups; if we ever expand it, this might need further generalization:
+               // eslint-disable-next-line jquery/no-each-util
                $.each( views, function ( viewName, viewData ) {
                        viewData.groups.forEach( function ( groupData ) {
                                var extraValues = [];
         * Check if new changes, newer than those currently shown, are available
         *
         * @return {jQuery.Promise} Promise object that resolves with a bool
-        *      specifying if there are new changes or not
+        *   specifying if there are new changes or not
         *
         * @private
         */
                        this.filtersModel.getViewTrigger( view )
                );
        };
-}( mediaWiki, jQuery ) );
+}() );