build: Replace jscs, jshint and jsonlint by eslint

Bug: T210365
Change-Id: I184e594a3be8010c9c6561b2b66e5596905a40fe
This commit is contained in:
Umherirrender 2020-02-03 20:49:46 +01:00
parent 30eace5dec
commit 3b8629ad9b
6 changed files with 763 additions and 1734 deletions

10
.eslintrc.json Normal file
View file

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

1
.gitignore vendored
View file

@ -5,3 +5,4 @@
node_modules/
/composer.lock
/vendor/
/.eslintcache

View file

@ -1,2 +0,0 @@
node_modules
vendor

View file

@ -1,29 +1,27 @@
/*jshint node:true */
/* eslint-env node, es6 */
module.exports = function ( grunt ) {
'use strict';
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.initConfig( {
jshint: {
all: [
'*.js'
]
},
banana: {
all: 'i18n'
},
jsonlint: {
eslint: {
options: {
extensions: [ '.js', '.json' ],
cache: true
},
all: [
'**/*.json',
'**/*.{js,json}',
'!node_modules/**',
'!vendor/**'
]
}
} );
grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'test', [ 'eslint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

2459
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,10 +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": "0.11.3",
"grunt-jscs": "2.5.0",
"grunt-jsonlint": "1.0.7"
"grunt-eslint": "22.0.0"
}
}