Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372126 )

Change subject: Upgrade eslint to 4.1.0 and use latest eslint-config-wikimedia
......................................................................

Upgrade eslint to 4.1.0 and use latest eslint-config-wikimedia

Latest eslint-config-wikimedia inhertis from eslint:recommended set.
So there are a few fixes made to make tests pass.

Change-Id: I5c7795332d554a35dd2625f1e9984f9bb5985211
---
M lib/dictionary/dict/DictClient.js
M lib/lineardoc/Builder.js
M lib/lineardoc/TextBlock.js
M lib/mt/annotationmapper/SubsequenceMatcher.js
M lib/routes/doc.js
M lib/util.js
M package.json
7 files changed, 20 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/26/372126/1

diff --git a/lib/dictionary/dict/DictClient.js 
b/lib/dictionary/dict/DictClient.js
index be40e48..0f20a28 100644
--- a/lib/dictionary/dict/DictClient.js
+++ b/lib/dictionary/dict/DictClient.js
@@ -125,7 +125,7 @@
                        defs[ word ] = [];
                        for ( dbIdx in words[ word ].db ) {
                                db = words[ word ].db[ dbIdx ];
-                               req = 'd ' + db + ' "' + word + '"' + '\r\n';
+                               req = 'd ' + db + ' "' + word + '"\r\n';
                                reqQueue.push( {
                                        request: req,
                                        word: word,
@@ -264,7 +264,7 @@
                                        // also checking whether db isn't on 
ignore list
                                        if ( ( currentReq.type === 'def' ) && 
options.suggestions ) {
                                                reqQueue.push( {
-                                                       request: 'match ' + 
currentReq.db + ' lev "' + currentReq.word + '"' + '\r\n',
+                                                       request: 'match ' + 
currentReq.db + ' lev "' + currentReq.word + '"\r\n',
                                                        type: 'sug',
                                                        word: currentReq.word
                                                } );
diff --git a/lib/lineardoc/Builder.js b/lib/lineardoc/Builder.js
index 57d69f8..35c474e 100644
--- a/lib/lineardoc/Builder.js
+++ b/lib/lineardoc/Builder.js
@@ -99,11 +99,11 @@
                whitespace.reverse();
                this.addInlineContent(
                        new Doc()
-                       .addItem( 'open', tag )
-                       .addItem( 'textblock', new TextBlock(
-                               [ new TextChunk( whitespace.join( '' ), [] ) ]
-                       ) )
-                       .addItem( 'close', tag )
+                               .addItem( 'open', tag )
+                               .addItem( 'textblock', new TextBlock(
+                                       [ new TextChunk( whitespace.join( '' ), 
[] ) ]
+                               ) )
+                               .addItem( 'close', tag )
                );
        }
        return tag;
diff --git a/lib/lineardoc/TextBlock.js b/lib/lineardoc/TextBlock.js
index 5b42171..abf417c 100644
--- a/lib/lineardoc/TextBlock.js
+++ b/lib/lineardoc/TextBlock.js
@@ -446,7 +446,7 @@
                                // sub-doc: concatenate
                                dump.push.apply( dump, 
chunk.inlineContent.dumpXmlArray( pad + '  ' ) );
                        } else {
-                               dump.push( pad + '  ' + '<' + 
chunk.inlineContent.name + '/>' );
+                               dump.push( pad + '  <' + 
chunk.inlineContent.name + '/>' );
                        }
                        dump.push( pad + '</cxinlineelement>' );
                }
diff --git a/lib/mt/annotationmapper/SubsequenceMatcher.js 
b/lib/mt/annotationmapper/SubsequenceMatcher.js
index 1766197..1a9f823 100644
--- a/lib/mt/annotationmapper/SubsequenceMatcher.js
+++ b/lib/mt/annotationmapper/SubsequenceMatcher.js
@@ -11,11 +11,11 @@
  */
 function cleanup( str ) {
        // Beginning
-       str = str.replace( /^[\,\.\/#!$%\^&\*;:"{}=_`~()]+/g, '' );
+       str = str.replace( /^[,./#!$%^&*;:"{}=_`~()]+/g, '' );
        // End
-       str = str.replace( /[\,\.\/#!$%\^&\*;:"{}=_`~()]+$/g, '' );
+       str = str.replace( /[,./#!$%^&*;:"{}=_`~()]+$/g, '' );
        // In between string
-       str = str.replace( /[\,\/#!$%\^&\*;:"{}=_`~()]+/g, '' );
+       str = str.replace( /[,/#!$%^&*;:"{}=_`~()]+/g, '' );
        return str;
 }
 
diff --git a/lib/routes/doc.js b/lib/routes/doc.js
index 01e0476..04de145 100644
--- a/lib/routes/doc.js
+++ b/lib/routes/doc.js
@@ -23,7 +23,7 @@
                                                '<title>' + 
app.conf.spec.info.title + ' docs</title>' )
                                        // Replace the default url with ours, 
switch off validation &
                                        // limit the size of documents to apply 
syntax highlighting to
-                                       .replace( /Sorter: "alpha"/, 'Sorter: 
"alpha", ' + 'validatorUrl: null, ' +
+                                       .replace( /Sorter: "alpha"/, 'Sorter: 
"alpha", validatorUrl: null, ' +
                                                'highlightSizeThreshold: 10000, 
docExpansion: "list"' )
                                        .replace( / url: url,/, 'url: "?spec",' 
);
                        }
diff --git a/lib/util.js b/lib/util.js
index 3196571..5ff17f4 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -107,7 +107,7 @@
                var path = ( route.path + routerLayer.route.path.slice( 1 ) )
                        .replace( /\/:/g, '/--' )
                        .replace( /^\//, '' )
-                       .replace( /[\/?]+$/, '' );
+                       .replace( /[?]+$/, '' );
                path = app.metrics.normalizeName( path || 'root' );
                routerLayer.route.stack.forEach( function ( layer ) {
                        var origHandler = layer.handle;
@@ -210,9 +210,10 @@
                        level = 'info';
                }
                // log the error
-               ( req.logger || app.logger ).log( level + '/' +
-                       ( errObj.component ? errObj.component : errObj.status ),
-                       errForLog( errObj ) );
+               ( req.logger || app.logger ).log(
+                       level + '/' +   ( errObj.component ? errObj.component : 
errObj.status ),
+                       errForLog( errObj )
+               );
                // let through only non-sensitive info
                respBody = {
                        status: errObj.status,
@@ -311,7 +312,7 @@
 }
 
 function Deferred() {
-       this.promise = new Promise( ( function( resolve, reject ) {
+       this.promise = new Promise( ( function ( resolve, reject ) {
                this.resolve = resolve;
                this.reject = reject;
        } ).bind( this ) );
diff --git a/package.json b/package.json
index 7e9db95..c319e9e 100644
--- a/package.json
+++ b/package.json
@@ -41,11 +41,11 @@
     "check-dependencies": "^0.12.0",
     "extend": "^3.0.0",
     "mocha": "^2.5.3",
-    "mocha-eslint": "^3.0.1",
+    "mocha-eslint": "^4.1.0",
     "mocha-lcov-reporter": "^1.2.0",
     "node-inspector": "^0.12.6",
     "nsp": "^2.6.1",
-    "eslint-config-wikimedia": "0.3.0"
+    "eslint-config-wikimedia": "0.4.0"
   },
   "scripts": {
     "start": "service-runner",

-- 
To view, visit https://gerrit.wikimedia.org/r/372126
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c7795332d554a35dd2625f1e9984f9bb5985211
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to