jest-community / jest-runner-eslint

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

jest runner output different to running eslint directly #242

Open dogmatic69 opened 5 months ago

dogmatic69 commented 5 months ago

I've updated to v9 and using eslint.config.js. When running jest-runner through jest with watch the linting passes.

If I run eslint directly, some things fail.

I've not made any changes to the jest.config.js file since upgrading.


module.exports = {
  projects: [
    {
      runner: 'jest-runner-eslint',
      displayName: 'lint',
      testMatch: [
        '/app/src/*.js',
        '/app/src/**/*.js',
        '/app/tests/*.js',
        '/app/tests/**/*.js',
      ],
    },
...

I would expect the results to be identical (it was before v9). Was not clear from the recent PR if something needs changing in the config.

ljharb commented 5 months ago

What happens with flat config and eslint v8?

benasher44 commented 3 months ago

We're having the same issue, and we were previously on v8 + flat config

benasher44 commented 3 months ago

Okay so I think I figured this out. In v9 reportUnusedDisableDirectives has a new default, which is not false (maybe it's warn or something, but it emits messages). However, jest-runner-eslint (without additional configuration) resolves the reportUnusedDisableDirectives to false, which ends up suppressing those messages.

ljharb commented 3 months ago

That indeed sounds like we need to default that to a different value in eslint 9.