jest-community / jest-runner-eslint

An ESLint runner for Jest
MIT License
479 stars 46 forks source link

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

Open lencioni opened 7 years ago

lencioni commented 7 years ago

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 commented 7 years ago

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 -> https://github.com/facebook/jest/issues/4278

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

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

ljharb commented 7 years ago

Can runner options be passed on the command line?

rogeliog commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 https://github.com/facebook/jest/issues/4278#issuecomment-326676409