build: Replace jshint/jsonlint with eslint

Bug: T195542
Change-Id: I9fc04c658a8d593abc6d272b0f49809c60ec791a
This commit is contained in:
zoranzoki21 2020-03-15 09:38:55 +01:00 committed by Krinkle
parent b77c7e6974
commit 7b24e036ed
4 changed files with 992 additions and 139 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

@ -1,21 +1,24 @@
/* eslint-env node, es6 */ /* eslint-env node, es6 */
module.exports = function ( grunt ) { module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-jsonlint' ); var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.initConfig( { grunt.initConfig( {
banana: { banana: conf.MessagesDirs,
all: 'i18n/' eslint: {
options: {
extensions: [ '.js', '.json' ]
}, },
jsonlint: {
all: [ all: [
'**/*.json', '**/*.js{,on}',
'!node_modules/**', '!node_modules/**',
'!vendor/**' '!vendor/**'
] ]
} }
} ); } );
grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] ); grunt.registerTask( 'test', [ 'eslint', 'banana' ] );
grunt.registerTask( 'default', 'test' ); grunt.registerTask( 'default', 'test' );
}; };

1084
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,8 +4,9 @@
"test": "grunt test" "test": "grunt test"
}, },
"devDependencies": { "devDependencies": {
"eslint-config-wikimedia": "0.15.0",
"grunt": "1.0.4", "grunt": "1.0.4",
"grunt-banana-checker": "0.8.1", "grunt-banana-checker": "0.8.1",
"grunt-jsonlint": "1.1.0" "grunt-eslint": "22.0.0"
} }
} }