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

Allows to generate eslint reports using --output-file #35154

Closed
wants to merge 1 commit into from

Conversation

zomars
Copy link

@zomars zomars commented Mar 8, 2022

Running next lint doesn't allow to generate an output file. This can be useful to generate GitHub Annotations via Actions like this one.

yarn next lint --format json --output-file test.json
yarn run v1.22.17
$ /node_modules/.bin/next lint --format json --output-file test.json
Unknown or unexpected option: --output-file
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Feature

  • Implements an existing feature request or RFC.

Copy link
Collaborator

@housseindjirdeh housseindjirdeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would definitely be useful to have! Unfortunately, the ESLint Node API doesn't support --output-file as an option (see the list of options here).

If you would still like to see this flag supported, you'll need to include it as a top-level option and then provide some custom logic for it within the runLintCheck method. You can see a similar example of how I added support for the --quiet flag in this commit.

If this is too much work to do, you can always fallback to using the default ESLint CLI to achieve your outcome (npx eslint pages -format json --output-file test.json).

Let me know if you have any thoughts or questions!

@housseindjirdeh
Copy link
Collaborator

@zomars Friendly ping :)

Any chance you can work on this PR per my previous comment? I'll close this for the meantime, but happy to re-open it if you decide to work on it!

@zomars
Copy link
Author

zomars commented Mar 30, 2022

I can't seem to be able to reopen this PR

@pepoeverton
Copy link
Contributor

Hello folks @housseindjirdeh @zomars
@zomars are you or someone else working on this PR? I'm working on a task that needs eslint output, so i can work on this PR if no one is on it!

@zomars
Copy link
Author

zomars commented Apr 22, 2022

Hello folks @housseindjirdeh @zomars

@zomars are you or someone else working on this PR? I'm working on a task that needs eslint output, so i can work on this PR if no one is on it!

Hi @pepoeverton I haven't been able to work on this unfortunately.

@housseindjirdeh
Copy link
Collaborator

@pepoeverton Thank you, yes please feel free to work on this! Let me know if you need me to open this PR but it'll probably be easier to submit a new one :)

@pepoeverton
Copy link
Contributor

Hi Folks, I just opened this PR that allows this flag, so feel free to review and comment if it needs some changes!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants