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

Pre-work to update to ESLint 8 #5699

Merged
merged 3 commits into from
Nov 8, 2021
Merged

Pre-work to update to ESLint 8 #5699

merged 3 commits into from
Nov 8, 2021

Conversation

mattxwang
Copy link
Member

@mattxwang mattxwang commented Nov 7, 2021

Which issue, if any, is this issue related to?

Not an issue, but part of the discussion in #5645.

Is there anything in the PR that needs further explanation?

This PR slightly took on scope creep (from the initial ask to just update eslint-shared-config to major version 15. Here's my thought process:

  1. First, I bumped the above
  2. Then, this causes an error with eslint-plugin-jest. I could resolve this by manually reinstalling it as a dev dependency. I'm not sure if this is the right move; if it isn't, let me know and I can move this commit out of the PR.
  3. Finally, I address the newly enabled jest/prefer-to-be rule, which was a simple find-and-replace.

Let me know if we'd prefer dependabot to handle. I'm using node 16 to generate the new package-lock, and we stay on lockfile v2.

@mattxwang mattxwang changed the title Bump eslint-shared-config from 14.0.0 to 15.0.0 Pre-work to update to ESLint 8 Nov 7, 2021
@ybiquitous
Copy link
Member

@mattxwang Thank you for creating this PR! 😄

I try removing eslint-plugin-jest, but it also works:

$ npm rm eslint-plugin-jest
...

$ npm ls eslint-plugin-jest
stylelint@14.0.1 /Users/koba/git/stylelint/stylelint
└─┬ eslint-config-stylelint@15.0.0
  └── eslint-plugin-jest@25.2.3

$ npm run lint:js -- --no-cache

> stylelint@14.0.1 lint:js
> eslint . --cache --max-warnings=0 "--no-cache"

@ntwb
Copy link
Member

ntwb commented Nov 8, 2021

Then, this causes an error with eslint-plugin-jest. I could resolve this by manually reinstalling it as a dev dependency. I'm not sure if this is the right move; if it isn't, let me know and I can move this commit out of the PR.

Yeah, I had the same issue locally it worked without this, installing resolved it for me also /shrug

I try removing eslint-plugin-jest, but it also works:
@ybiquitous Depenadbot created another PR ~8 hours ago, same issue in that PR:

TypeError: Failed to load plugin 'jest' declared in 'package.json » eslint-config-stylelint': Class extends value undefined is not a constructor or null
Referenced from: /home/runner/work/stylelint/stylelint/node_modules/eslint-config-stylelint/index.js

Copy link
Member

@ntwb ntwb left a comment

Choose a reason for hiding this comment

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

Per my comment #5699 (comment) I'm happy to approve this and land this as-is, we can revisit removing the eslint-plugin-jest plugin later

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

@ntwb Ah, I see. Thanks for the feedback! 😄

LGTM 👍🏼

@mattxwang
Copy link
Member Author

Thanks everyone! I can also try to see if removing eslint-plugin-jest resolves this in the future, maybe this is a node version thing and/or something resolved with ESLint 8?

@mattxwang mattxwang merged commit 76f6fe0 into main Nov 8, 2021
@mattxwang mattxwang deleted the bump-eslint-shared-config branch November 8, 2021 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants