I know eslint CLI itself has a --fix flag, but I can't tell from the documentation how to use this via eslintConfig (in package.json) or in the grunt-eslint configuration in my Gruntfile.
I have the following config in package.json:
"env": {
"browser": true,
"amd": true
},
"extends": "eslint:recommended",
and invoke it via a lint task using this Grunt config:
eslint: {
target: [
'src/app/**/*.js'
],
format: 'checkstyle'
},
How can I enable the --fix flag in this scenario?
For the
--fixflag, you only have to add anoptions: { fix: true }to your gruntfile.Here is an example of my gruntfile eslint task (
grunt-eslint 18.1.0witheslint 2.12.0):