diff --git a/Gruntfile.js b/Gruntfile.js index c16e062b8c..7581d179b3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -17,6 +17,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-mocha'); grunt.loadNpmTasks('grunt-parallel'); + grunt.loadNpmTasks('grunt-run'); grunt.loadTasks('build/tasks'); var langs; @@ -248,7 +249,7 @@ module.exports = function(grunt) { }, watch: { files: ['lib/**/*', 'test/**/*.js', 'Gruntfile.js'], - tasks: ['build', 'testconfig', 'fixture'] + tasks: ['run:npm_run_eslint', 'build', 'testconfig', 'fixture'] }, testconfig: { test: { @@ -337,6 +338,12 @@ module.exports = function(grunt) { base: ['.'] } } + }, + run: { + npm_run_eslint: { + cmd: 'npm', + args: ['run', 'eslint'] + } } }); @@ -389,6 +396,7 @@ module.exports = function(grunt) { ]); grunt.registerTask('dev', [ + 'run:npm_run_eslint', 'build', 'testconfig', 'fixture', diff --git a/package.json b/package.json index 70ff98b212..b2c7f3560e 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "scripts": { "api-docs": "jsdoc --configure .jsdoc.json", "build": "grunt", - "eslint": "eslint --format stylish '{lib,test,build,doc}/**/*.js' 'Gruntfile.js'", + "eslint": "eslint --color --format stylish '{lib,test,build,doc}/**/*.js' 'Gruntfile.js'", "test": "npm run retire && tsc && grunt test", "version": "echo \"use 'npm run release' to bump axe-core version\" && exit 1", "prepublishOnly": "grunt build && grunt file-exists", @@ -93,6 +93,7 @@ "grunt-contrib-watch": "^1.1.0", "grunt-mocha": "1.1.0", "grunt-parallel": "^0.5.1", + "grunt-run": "^0.8.1", "html-entities": "^1.2.0", "husky": "^1.1.1", "jquery": "^3.0.0",