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

Support ESLint 8.x #881

Closed
Tracked by #379 ...
MichaelDeBoey opened this issue Aug 28, 2021 · 15 comments · Fixed by #940
Closed
Tracked by #379 ...

Support ESLint 8.x #881

MichaelDeBoey opened this issue Aug 28, 2021 · 15 comments · Fixed by #940

Comments

@MichaelDeBoey
Copy link
Contributor

MichaelDeBoey commented Aug 28, 2021

ESLint v8.0.0 is released 🎉

It would be awesome to have official ESLint 8 support. 👊
I'm happy to help where I can of course 🙂

@G-Rath
Copy link
Collaborator

G-Rath commented Aug 28, 2021

Thanks, I've got a branch locally covering this but we need @typescript-eslint to support v8 before we'll be able to properly look at supporting.

@zdm
Copy link

zdm commented Oct 11, 2021

@typescript updated to the version 5 and supports eslint 8 now.

@SimenB
Copy link
Member

SimenB commented Oct 11, 2021

Yeah, we released an update a couple of hours ago: https://github.com/jest-community/eslint-plugin-jest/releases/tag/v25.0.4

Cannot test against eslint@8 for some reason, but I think consumers should be unblocked

@EvHaus
Copy link

EvHaus commented Oct 11, 2021

I'm getting this error when trying to use eslint-plugin-jest@25.0.4 with eslint@8.0.0:

TypeError: Failed to load plugin 'jest' declared in '.eslintrc.js': Class extends value undefined is not a constructor or null

UPDATE: This problem went away for us after installing the latest eslint-plugin-jest@25.2.2

@zdm
Copy link

zdm commented Oct 11, 2021

In v25.0.5 you forget to update peer deps:

"peerDependencies": {
    "@typescript-eslint/eslint-plugin": "^4.0.0 || ^5.0.0",
    "eslint": "^6.0.0 || ^7.0.0"
  },

I am unable to install it, because it conflicts with the @typescript, which is requires eslint 8.
Please, add ^8.0.0 to allowed eslint versions.

@SimenB
Copy link
Member

SimenB commented Oct 11, 2021

@EvHaus huh, unexpected... I'm also unable to reproduce in a fresh repo doing yarn add eslint eslint-plugin-jest

// package.json
{
  "name": "eslint-8",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "eslint": "^8.0.0",
    "eslint-plugin-jest": "^25.0.5"
  }
}
// .eslintrc
{"plugins": ["jest"], "rules": {"jest/expect-expect": "error"}}
// test.js
test('dummy', function() {
  // no expect here
})

image

@SimenB
Copy link
Member

SimenB commented Oct 11, 2021

@zdm no, we're unable to test against it. You can ignore the peer dep warning if you want, but seeing as this issue is still open support isn't officially released yet 🙂

@zdm
Copy link

zdm commented Oct 11, 2021

It is not warning, npd dies with error.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @softvisio/cli@3.17.2
npm ERR! Found: eslint@8.0.0
npm ERR! node_modules/eslint
npm ERR!   eslint@"^8.0.0" from the root project
npm ERR!   peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0" from @typescript-eslint/eslint-plugin@5.0.0
npm ERR!   node_modules/@typescript-eslint/eslint-plugin
npm ERR!     @typescript-eslint/eslint-plugin@"^5.0.0" from the root project
npm ERR!     peerOptional @typescript-eslint/eslint-plugin@"^4.0.0 || ^5.0.0" from eslint-plugin-jest@25.0.5
npm ERR!     node_modules/eslint-plugin-jest
npm ERR!       eslint-plugin-jest@"^25.0.5" from the root project
npm ERR!   1 more (@typescript-eslint/parser)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^6.0.0 || ^7.0.0" from eslint-plugin-jest@25.0.5
npm ERR! node_modules/eslint-plugin-jest
npm ERR!   eslint-plugin-jest@"^25.0.5" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\zdm\.n

@SimenB
Copy link
Member

SimenB commented Oct 11, 2021

npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

there's your workaround. It's just a warning. If that's not acceptable, you can wait until this issue is closed

@chrisfosterelli
Copy link

If it helps, we also got the same error as @EvHaus during a dependabot upgrade prompt for eslint 8. I assumed the issue was that we just needed to update eslint-plugin-jest for compatibility, but then got the peer dependency mismatch error @zdm indicated.

The legacy peer dep resolution is no longer the default for (presumably) good reasons and that flag enables it for one's whole app -- so we'll probably wait to see the peer dependency list updated.

@SimenB
Copy link
Member

SimenB commented Oct 14, 2021

@ume-kun1015
Copy link

still getting the same error as this one. can anyone help?
#881 (comment)

@SimenB
Copy link
Member

SimenB commented Oct 18, 2021

Please open up a separate issue with a reproduction

@basitsattar
Copy link

still getting the same error as this one. can anyone help? #881 (comment)

Did you find any solution? facing the same issue

@SimenB
Copy link
Member

SimenB commented Oct 21, 2021

Just open up a new issue with a reproduction. I assume you'll find your error while reducing your own project down to a reproduction, but if not I'm happy to fix it

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