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

feat: Support ESLint 7.x #92

Merged
merged 11 commits into from Jul 4, 2020
Merged

Conversation

MichaelDeBoey
Copy link
Contributor

@MichaelDeBoey MichaelDeBoey commented May 17, 2020

ESLint v7.0.0 is released 🎉

(dev)Dependencies should be compatible with ESLint 7 too before we can merge this one:


Closes #78
Closes #91

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

.travis.yml Outdated Show resolved Hide resolved
@ljharb
Copy link
Collaborator

ljharb commented May 17, 2020

@MichaelDeBoey please rebase and mark as "ready for review" once tests are passing :-)

@MichaelDeBoey
Copy link
Contributor Author

MichaelDeBoey commented May 18, 2020

@ljharb This one's waiting for eslint-plugin-import to be released

@ljharb
Copy link
Collaborator

ljharb commented May 18, 2020

aha, thanks, that’s on me. Hopefully this week.

@SimenB
Copy link
Member

SimenB commented May 27, 2020

CI seems unhappy for the same reason as in #78. We probably want to leave the eslint config alone

package.json Outdated Show resolved Hide resolved
@MichaelDeBoey MichaelDeBoey marked this pull request as ready for review June 11, 2020 08:54
@MichaelDeBoey
Copy link
Contributor Author

@ljharb Any idea how to resolve ESLint errors?

@ljharb
Copy link
Collaborator

ljharb commented Jun 11, 2020

I see a few errors; one of them is because yarn incorrectly fails installs when engines mismatch (they’re advisory only); if there’s a way to yarn install without that check, that’s the fix there (or switching to the standard package manager, of course)

The linting error suggests that perhaps eslint isn’t properly updated in the lockfile? I don’t use lockfiles on packages so I’m not sure, but my guess is if you deleted and recreated the lockfile it’d pass.

@ljharb
Copy link
Collaborator

ljharb commented Jun 11, 2020

Seems like the eslint 4 tests won't work with the camelcase rule; i wonder if we could override those, with something like --rule=camelcase:0 or something?

@SimenB
Copy link
Member

SimenB commented Jun 11, 2020

yarn --ignore-engines

@ljharb
Copy link
Collaborator

ljharb commented Jun 11, 2020

Looks like the yarn add commands also need --ignore-engines.

@ljharb
Copy link
Collaborator

ljharb commented Jun 12, 2020

k i think the last issue is that for eslint 4, we have to have a way to override the config for the camelcase rule, since it has options that only exist in eslint 5+.

@MichaelDeBoey
Copy link
Contributor Author

@ljharb Any idea how I could do this override?

@ljharb
Copy link
Collaborator

ljharb commented Jun 18, 2020

You could pass --rule="camelcase:0" in travis.yml to disable it, for example?

@MichaelDeBoey
Copy link
Contributor Author

@ljharb I tried just adding it, but that didn't work.
I also have no clue how I should do it otherwise, so I would be happy if you could help me out here.

@MichaelDeBoey
Copy link
Contributor Author

@ljharb Any idea how I could resolve the failures exactly?
Would love to have this one (and all other ESLint PRs) merged asap 🙂

@ljharb ljharb force-pushed the eslint-7 branch 2 times, most recently from b4a5376 to 16cab9b Compare July 3, 2020 06:47
@ljharb
Copy link
Collaborator

ljharb commented Jul 3, 2020

First, I updated the test matrix; the peer deps support jest 21-26 and eslint 4-7, and the implied node version somewhere between 4-14, depending on which combo you're using.

As is, tests are failing on jest 21, 22, and 23 on master, as well as on eslint 4 with all versions of jest: https://travis-ci.org/github/jest-community/jest-runner-eslint/builds/704554241


Next, I tried to fix the eslint 4 failures, which were just about the camelcase rule's extra option. I did that by, in travis, when eslint was v4, installing eslint-config-airbnb-base@13. That left these failures: https://travis-ci.org/github/jest-community/jest-runner-eslint/builds/704558140 which are, "still failing on jest < 24" but passing on eslint 4.


Failures are: on jest 21, "TypeError: glob pattern string required"; on jest 22, "SecurityError: localStorage is not available for opaque origins" (fixed with advice from jsdom/jsdom#2304); and on jest 22 and 23, related to babel 6 vs 7 : https://travis-ci.org/github/jest-community/jest-runner-eslint/builds/704562583


The node 4 failure is because travis' default yarn version doesn't work on node 4, yay.

In other words, it seems like unless we want to a) ditch yarn (which i strongly recommend anyways, for a variety of reasons), b) do some babel 6/7 hijinx in travis.yml, c) fix whatever actual test failures pop up, if any (i actually suspect everything works fine! it's just that it hasn't been properly tested for a long time, so who knows) - then we'd want to just drop whatever's failing.

It also looks like "projects" isn't supported in jest 21 at all inside a config file.

So, I added a commit that drops support for eslint < 6 and jest < 25 (ie, so we keep supporting the last 2 versions of both eslint and jest). Moving forward, we'll be able to ensure we test every node and eslint and jest version combo that's supported, and prevent this kind of situation from happening again.

@SimenB
Copy link
Member

SimenB commented Jul 3, 2020

Supporting last 2 majors seems reasonable to me! 👍

.travis.yml Show resolved Hide resolved
@MichaelDeBoey
Copy link
Contributor Author

CI failed because of removing --ignore-engines, so I added it back:
https://travis-ci.org/github/jest-community/jest-runner-eslint/jobs/704613630

@SimenB
Copy link
Member

SimenB commented Jul 3, 2020

Huh - what's installing semver@7 when we target node 8?

@MichaelDeBoey
Copy link
Contributor Author

Investigating as we speak 🙂

@MichaelDeBoey
Copy link
Contributor Author

@SimenB It seems to be triggered whenever eslint@6 is installed.
However when I create a clean project and I install eslint@6, it will install semver@6.3.0
Schermafbeelding 2020-07-03 om 12 37 51

package.json Show resolved Hide resolved
@ljharb
Copy link
Collaborator

ljharb commented Jul 3, 2020

(note that --ignore-engines should be the default; the "engines" field is and always has been purely advisory, so i think it's fine to not resolve this yarn error)

@MichaelDeBoey
Copy link
Contributor Author

@ljharb --ignore-engines is added again, so this is good to be merged 🙂

@ljharb ljharb merged commit 2b0d259 into jest-community:master Jul 4, 2020
@MichaelDeBoey
Copy link
Contributor Author

MichaelDeBoey commented Jul 4, 2020

Thanks for merging @ljharb! 👊

@MichaelDeBoey MichaelDeBoey deleted the eslint-7 branch July 4, 2020 10:11
.travis.yml Show resolved Hide resolved
@MichaelDeBoey
Copy link
Contributor Author

@SimenB Any idea when this will be released? 🤔

@SimenB
Copy link
Member

SimenB commented Jul 4, 2020

I'd like to bump all other dependencies as well first (at least the ones that still support node 8)

@MichaelDeBoey
Copy link
Contributor Author

@SimenB On it boss! 😉

@SimenB
Copy link
Member

SimenB commented Jul 4, 2020

@MichaelDeBoey I've opened up #98

@SimenB
Copy link
Member

SimenB commented Jul 4, 2020

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

Successfully merging this pull request may close these issues.

Support ESLint 7.x
4 participants