build: Replace jshint with eslint

Bug: T210365
Change-Id: Ia5c2cfa722963d03a06f4c1799be5012229b1637
This commit is contained in:
Ed Sanders 2018-11-29 17:14:03 +00:00 committed by Jforrester
parent 02ada1b4f2
commit dc2caad941
4 changed files with 26 additions and 8 deletions

11
.eslintrc.json Normal file
View file

@ -0,0 +1,11 @@
{
"root": true,
"extends": [
"wikimedia/client",
"wikimedia/jquery"
],
"globals": {
"mw": false,
"OO": false
}
}

View file

@ -4,16 +4,17 @@
* @package SpamBlacklist
*/
/*jshint node:true */
/* eslint-env node, es6 */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.initConfig( {
banana: conf.MessagesDirs,
jshint: {
eslint: {
all: [
'**/*.js',
'!node_modules/**',
@ -29,6 +30,6 @@ module.exports = function ( grunt ) {
}
} );
grunt.registerTask( 'test', [ 'jsonlint', 'banana', 'jshint' ] );
grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

View file

@ -0,0 +1,5 @@
{
"globals": {
"ve": true
}
}

View file

@ -7,9 +7,10 @@
"test": "grunt test"
},
"devDependencies": {
"eslint-config-wikimedia": "0.9.0",
"grunt": "1.0.3",
"grunt-banana-checker": "0.6.0",
"grunt-contrib-jshint": "1.1.0",
"grunt-eslint": "21.0.0",
"grunt-jsonlint": "1.1.0"
}
}