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 */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-jsonlint' );
var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.initConfig( {
banana: {
all: 'i18n/'
},
jsonlint: {
banana: conf.MessagesDirs,
eslint: {
options: {
extensions: [ '.js', '.json' ]
},
all: [
'**/*.json',
'**/*.js{,on}',
'!node_modules/**',
'!vendor/**'
]
}
} );
grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
grunt.registerTask( 'test', [ 'eslint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

1100
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

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