sindresorhus / grunt-eslint

Validate files with ESLint
MIT License
200 stars 72 forks source link

Generating lint output in multiple formats #127

Open ansujohn opened 8 years ago

ansujohn commented 8 years ago

Is there a way to generate the output in default format as well as checkstyle format saved into a file?

Thank you.

sindresorhus commented 8 years ago

Not at the moment. You can output to a file, but not both.

akaguny commented 7 years ago

@ansujohn what is youre case? if you want y may create middleware, that mocks stdout, append this to file and get out stdout.

ansujohn commented 7 years ago

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

nfriedly commented 5 years ago

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.

diegodossantos95 commented 4 years ago

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.

Miuler commented 4 years ago

+1

prantlf commented 6 months ago

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.