grunt-eslint
grunt-eslint copied to clipboard
Generating lint output in multiple formats
Is there a way to generate the output in default format as well as checkstyle format saved into a file?
Thank you.
Not at the moment. You can output to a file, but not both.
@ansujohn what is youre case? if you want y may create middleware, that mocks stdout, append this to file and get out stdout.
My eslint config is like this 'eslint': { options: { format: 'checkstyle', outputFile: 'target/checkstyle.xml', quiet: true
},
target: ['*.js', 'src/**/*.js', 'test/**/*.js']
}
I need the checkstyle format for integrating with jenkins.
While doing development i would like to run grunt lint and see the output in stdout as well. Because the plugin does not support multiple output formats I need to open the checkstyle.xml to view the errors.
I had created a PR to fix this issue https://github.com/sindresorhus/grunt-eslint/pull/130
Please look at it.
Thanks
I'd like this as well. Exact same use-case. When developing locally, I want to see the errors on the stdout. When it runs on Jenkins, I want both text output for humans reading the logs and a checkstyle file for Jenkins.
Any update on this? I also want to have the ESLint running in my CI pipeline with checkstyle report and locally showing the errors on the stdout. Thanks.
+1
You could use conditional configuration. For example, if process.env.CI
is set, use the formatter checkstyle
(build pipeline), otherwise stylish
(local machine). I don't see necessary writing to multiple outputs.