Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating lint output in multiple formats #127

Open
ansujohn opened this issue Jul 21, 2016 · 7 comments
Open

Generating lint output in multiple formats #127

ansujohn opened this issue Jul 21, 2016 · 7 comments

Comments

@ansujohn
Copy link

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

Thank you.

@sindresorhus
Copy link
Owner

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

@akaguny
Copy link

akaguny commented Jun 13, 2017

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

@ansujohn
Copy link
Author

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 #130

Please look at it.

Thanks

@nfriedly
Copy link

nfriedly commented Mar 20, 2019

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
Copy link

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
Copy link

Miuler commented Jul 30, 2020

+1

@prantlf
Copy link
Contributor

prantlf commented Apr 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants