WMDE-leszek has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354986 )

Change subject: Use eslint to lint JavaScript instead of jscs and jshint
......................................................................

Use eslint to lint JavaScript instead of jscs and jshint

Bug: T165843
Change-Id: I7550bb2553e5dabc793a7a113539dde60fba28f8
---
A .eslintignore
A .eslintrc.json
M Gruntfile.js
M package.json
A tests/qunit/.eslintrc.json
5 files changed, 31 insertions(+), 16 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder 
refs/changes/86/354986/1

diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000..82eaa05
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,2 @@
+node_modules/**
+vendor/**
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..c410740
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,13 @@
+{
+       "extends": "wikimedia",
+       "env": {
+               "browser": true,
+               "jquery": true
+       },
+       "rules": {
+               "dot-notation": "off",
+               "no-proto": "off",
+               "valid-jsdoc": "off",
+               "wrap-iife": "off"
+       }
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index e1af6af..eb5e877 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,20 +1,11 @@
-/*jshint node:true */
+/* eslint-env node */
+
 module.exports = function ( grunt ) {
        require( 'load-grunt-tasks' )( grunt );
 
        grunt.initConfig( {
-               jshint: {
-                       options: {
-                               jshintrc: true
-                       },
-                       all: [
-                               '*.js',
-                               'modules/**/*.js',
-                               'tests/**/*.js'
-                       ]
-               },
-               jscs: {
-                       src: '<%= jshint.all %>'
+               eslint: {
+                       all: '.'
                },
                banana: {
                        all: 'i18n/'
@@ -40,6 +31,6 @@
                }
        } );
 
-       grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana', 
'qunit', 'stylelint' ] );
+       grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'qunit', 
'stylelint' ] );
        grunt.registerTask( 'default', 'test' );
 };
diff --git a/package.json b/package.json
index 35a7ffc..d7d1c16 100644
--- a/package.json
+++ b/package.json
@@ -10,11 +10,11 @@
                "test": "grunt test"
        },
        "devDependencies": {
+               "eslint-config-wikimedia": "0.4.0",
                "grunt": "1.0.1",
                "grunt-banana-checker": "0.4.0",
-               "grunt-contrib-jshint": "0.11.2",
                "grunt-contrib-qunit": "^1.2.0",
-               "grunt-jscs": "2.1.0",
+               "grunt-eslint": "19.0.0",
                "grunt-jsonlint": "1.0.7",
                "grunt-stylelint": "0.6.0",
                "jquery": "^3.1.1",
diff --git a/tests/qunit/.eslintrc.json b/tests/qunit/.eslintrc.json
new file mode 100644
index 0000000..a974377
--- /dev/null
+++ b/tests/qunit/.eslintrc.json
@@ -0,0 +1,9 @@
+{
+       "extends": "../../.eslintrc.json",
+       "env": {
+               "qunit": true
+       },
+       "globals": {
+               "sinon": false
+       }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7550bb2553e5dabc793a7a113539dde60fba28f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: master
Gerrit-Owner: WMDE-leszek <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to