I've set up the grunt-eslint in my gruntfile.js, but when I run the "grunt eslint", nothing happens. The task looks like it would start but just stands still even after 15min.
All my other tasks works just fine, all except eslint which shows no errors or anything.
gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
eslint: {
options: {
configFile: '.eslintrc.json'
},
target: ['src/js/*.js']
},
})
grunt.loadNpmTasks('grunt-eslint');
grunt.registerTask('eslint', [
'eslint',
]);
}
.eslintrc.json
{
"env": {
"browser": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
}
}
Both the gruntfile and .eslintrc.json is in root
Does anyone know what it is that can cause this? Is my setup wrong?
I had the same problem.
If you add --verbose option when running:
You'll see that your task is running repeatedly - because you named your task eslint(which is the same name as already registered eslint task) grunt falls into infinite loop.
Change
to:
and run: