grunt-eslint icon indicating copy to clipboard operation
grunt-eslint copied to clipboard

Generating lint output in multiple formats

Open ansujohn opened this issue 8 years ago • 7 comments

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

Thank you.

ansujohn avatar Jul 21 '16 14:07 ansujohn

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

sindresorhus avatar Jul 21 '16 15:07 sindresorhus

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

akaguny avatar Jun 13 '17 13:06 akaguny

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

ansujohn avatar Jun 13 '17 13:06 ansujohn

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.

nfriedly avatar Mar 20 '19 20:03 nfriedly

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.

diegodossantos95 avatar Jun 02 '20 20:06 diegodossantos95

+1

Miuler avatar Jul 30 '20 19:07 Miuler

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.

prantlf avatar Apr 12 '24 05:04 prantlf