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

jest runner output different to running eslint directly #242

Open
dogmatic69 opened this issue May 30, 2024 · 4 comments
Open

jest runner output different to running eslint directly #242

dogmatic69 opened this issue May 30, 2024 · 4 comments

Comments

@dogmatic69
Copy link

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
Copy link
Collaborator

ljharb commented May 30, 2024

What happens with flat config and eslint v8?

@benasher44
Copy link

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

@benasher44
Copy link

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
Copy link
Collaborator

ljharb commented Aug 9, 2024

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

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

No branches or pull requests

3 participants