jest-community / jest-runner-eslint

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

Allow different cliOptions per project #133

Open gblock0 opened 2 years ago

gblock0 commented 2 years ago

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.

tyteen4a03 commented 1 year ago

+1 - would love this!

nsunga commented 11 months ago

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