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

Feature request: provide a way to run with --quiet and --fix options #10

Open
lencioni opened this issue Sep 12, 2017 · 5 comments
Open

Comments

@lencioni
Copy link
Contributor

I sometimes want to run eslint with the --quiet and --fix options to autofix rules across large numbers of files. I was unable to find a way to use these options with the jest runner and think it would be really great if there was a way.

If there is already a way, it would be wonderful to document it!

@rogeliog
Copy link
Member

rogeliog commented Sep 12, 2017

Hi 👋,

Thanks for reporting!

Yeah this will be real nice. I think this is part of a broader discussion (How to configure Jest runners?), for which there is an ongoing discussion here -> jestjs/jest#4278

Off the top of my head I think of some different paths that we could take.

  • Fix it in facebook/jest and allow for a way to customize runners
  • AFAIK passing unknown CLI args to Jest will cause jest to fail with an unrecognized arg error. Maybe there could be a way to pass extra unknown args, but this will get weird when running wiht multiple projects at the same time.
  • Come up with a solution similar to jest-runner-mocha#custom-config-options, where we add yet another config file(jest-runner-eslint.config.js) or field in the package.json

This doesn't mean that they are the correct solutions, so I'm more than open to better solutions

@ljharb
Copy link
Collaborator

ljharb commented Sep 12, 2017

Can runner options be passed on the command line?

@rogeliog
Copy link
Member

rogeliog commented Sep 12, 2017

That would be awesome but right now Jest returns

❯ yarn jest -- --watch --quiet --fix
● Unrecognized CLI Parameters:

  Following options were not recognized:
  ["quiet", "fix"]

  CLI Options Documentation:
  http://facebook.github.io/jest/docs/cli.html

error Command failed with exit code 1.

@ljharb
Copy link
Collaborator

ljharb commented Sep 12, 2017

That's not what I meant - custom reporters in a jest config can take options https://facebook.github.io/jest/docs/en/configuration.html#reporters-array-modulename-modulename-options - can those be provided via command line at all, in --reporters?

@rogeliog
Copy link
Member

Oh sorry, I misunderstood... my bad!

No, runners can't do that right now, but that is one of the proposals on how to add configs to runners jestjs/jest#4278 (comment)

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

No branches or pull requests

3 participants