build: Upgrade grunt-jscs and remove legacy jshint camelcase/nomen
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 18 Nov 2014 20:44:44 +0000 (20:44 +0000)
committerKrinkle <krinklemail@gmail.com>
Sun, 30 Nov 2014 19:02:22 +0000 (19:02 +0000)
Follows-up 4ec6b0cce.

grunt-jscs v0.7.0 upgraded node-jscs to v0.6.0 which introduced
the ability to disable rules via inline comments.

This means we can finally remove the deprecated jshint rules for
coding style rules and restrict jshint to code quality only.

Unsuppress the equivalent rules from jscs.

Change-Id: Idacf7e552d656ee139863d927e5bfc1f86af8283

.jscsrc
.jshintrc
resources/src/mediawiki.legacy/ajax.js
resources/src/mediawiki.special/mediawiki.special.upload.js
tests/frontend/package.json

diff --git a/.jscsrc b/.jscsrc
index b9139b2..2ebd40e 100644 (file)
--- a/.jscsrc
+++ b/.jscsrc
@@ -1,10 +1,8 @@
 {
        "preset": "wikimedia",
 
-       "disallowDanglingUnderscores": null,
        "disallowKeywordsOnNewLine": null,
        "disallowQuotedKeysInObjects": null,
-       "requireCamelCaseOrUpperCaseIdentifiers": null,
        "requireSpacesInsideArrayBrackets": null,
        "validateIndentation": null
 }
index c136dfc..92c8c43 100644 (file)
--- a/.jshintrc
+++ b/.jshintrc
@@ -22,9 +22,5 @@
                "mediaWiki": true,
                "jQuery": false,
                "QUnit": false
-       },
-
-       // Legacy (to be handled by jscs once supported)
-       "camelcase": true,
-       "nomen": true
+       }
 }
index 6b9464a..cf9e27f 100644 (file)
@@ -5,7 +5,7 @@
  * http://www.modernmethod.com/sajax/
  */
 
-/*jshint camelcase:false */
+/*jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
 /*global alert */
 ( function ( mw ) {
 
index 87de646..c6ee1a7 100644 (file)
                                };
                                img.src = dataURL;
                        }, mw.config.get( 'wgFileCanRotate' ) ? function ( data ) {
-                               /*jshint camelcase:false, nomen:false */
                                try {
                                        meta = mw.libs.jpegmeta( data, file.fileName );
+                                       // jscs:disable requireCamelCaseOrUpperCaseIdentifiers, disallowDanglingUnderscores
                                        meta._binary_data = null;
+                                       // jscs:enable
                                } catch ( e ) {
                                        meta = null;
                                }
index 7913363..9b15379 100644 (file)
@@ -9,7 +9,7 @@
     "grunt-contrib-jshint": "0.10.0",
     "grunt-contrib-watch": "0.6.1",
     "grunt-banana-checker": "0.2.0",
-    "grunt-jscs": "0.6.1",
+    "grunt-jscs": "0.8.1",
     "grunt-jsonlint": "1.0.4"
   }
 }