build: Install eslint

Change-Id: I61bcee70cf88b63f2d85ba46f2d66a83589cecaa
This commit is contained in:
James D. Forrester 2019-05-07 10:22:29 -07:00
parent 613f6f68d4
commit 3ce9e39bc3
4 changed files with 26 additions and 13 deletions

7
.eslintrc.json Normal file
View file

@ -0,0 +1,7 @@
{
"root": true,
"extends": [
"wikimedia/client",
"wikimedia/jquery"
]
}

1
.gitignore vendored
View file

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

View file

@ -1,17 +1,20 @@
/*jshint node:true */
/* eslint-env node, es6 */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.initConfig( {
banana: conf.MessagesDirs,
jshint: {
eslint: {
options: {
reportUnusedDisableDirectives: true,
cache: true
},
all: [
'**/*.js',
'!node_modules/**',
'!vendor/**'
'!{vendor,node_modules}/**'
]
},
jsonlint: {
@ -20,9 +23,10 @@ module.exports = function ( grunt ) {
'!node_modules/**',
'!vendor/**'
]
}
},
banana: conf.MessagesDirs
} );
grunt.registerTask( 'test', [ 'jsonlint', 'banana', 'jshint' ] );
grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

View file

@ -4,9 +4,10 @@
"test": "grunt test"
},
"devDependencies": {
"grunt": "1.0.3",
"eslint-config-wikimedia": "0.11.0",
"grunt": "1.0.4",
"grunt-banana-checker": "0.6.0",
"grunt-contrib-jshint": "1.1.0",
"grunt-eslint": "21.0.0",
"grunt-jsonlint": "1.1.0"
}
}