Replace jshint with eslint

Bug: T195542
Change-Id: I8e8d9f2e4917c9f412128c4ea19a55add8724d4f
This commit is contained in:
Taavi Väänänen 2019-12-07 18:01:25 +02:00
parent 2c3ff1ec57
commit 8ff3b41a62
4 changed files with 904 additions and 273 deletions

11
.eslintrc.json Normal file
View File

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

View File

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

1134
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,11 @@
"test": "grunt test"
},
"devDependencies": {
"eslint": "6.7.2",
"eslint-config-wikimedia": "0.15.0",
"grunt": "1.0.4",
"grunt-banana-checker": "0.6.0",
"grunt-contrib-jshint": "1.1.0",
"grunt-jsonlint": "1.1.0"
"grunt-banana-checker": "0.8.1",
"grunt-eslint": "22.0.0",
"grunt-jsonlint": "2.0.0"
}
}