jest-runner-eslint icon indicating copy to clipboard operation
jest-runner-eslint copied to clipboard

Allow different cliOptions per project

Open gblock0 opened this issue 2 years ago • 2 comments

Would it be possible to set cliOptions for specific Jest projects? I'm happy to take a swing at a PR with some direction if this is something the community would like.

The reasoning behind this is to allow us to run fix: true for one project and fix:false for another project. We'd like the latter project project to run during CI and fail the build.

gblock0 avatar Mar 25 '22 20:03 gblock0

+1 - would love this!

tyteen4a03 avatar Oct 22 '22 16:10 tyteen4a03

EDIT: I think I got it to work -- configuration done in package.json helped and also installing fresh node_modules

hello @gblock0 :wave:

it looks like u gave a good handle on how to use this package

specifically, cliOptions

is it possible for you to break down your project directory to call this runner with cliOptions being picked up?

I can make a jest.config.js like they mention

module.exports = {
  runner: 'jest-runner-eslint',
  displayName: 'lint',
  testMatch: ['<rootDir>/src/**/*.js'],
};

one of the cliOptions is ext: https://github.com/jest-community/jest-runner-eslint#clioptions

so I would assume something like testMatch in jest.config.js isnt needed - but in practice, I might be doing something wrong

nsunga avatar Oct 24 '23 21:10 nsunga