build: Replace jshint/jsonlint with eslint

Bug: TT195542
Change-Id: Ica7b0a1ac532bf39868edce1cdba2e73fd55c6a9
This commit is contained in:
zoranzoki21 2020-03-15 11:06:39 +01:00
parent b215f7e016
commit dce083ed33
4 changed files with 969 additions and 350 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,29 +1,24 @@
/*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' );
grunt.initConfig( {
banana: {
all: 'i18n/'
},
jshint: {
banana: conf.MessagesDirs,
eslint: {
options: {
extensions: [ '.js', '.json' ]
},
all: [
'**/*.js',
'!node_modules/**',
'!vendor/**'
]
},
jsonlint: {
all: [
'**/*.json',
'**/*.js{,on}',
'!node_modules/**',
'!vendor/**'
]
}
} );
grunt.registerTask( 'test', [ 'jsonlint', 'banana', 'jshint' ] );
grunt.registerTask( 'test', [ 'eslint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

1277
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

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