-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ESLint v8 (#35576) #36283
ESLint v8 (#35576) #36283
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. We still need to document all the major version updates for packages as breaking changes. We have some fixes included in this PR which confirm that upgrade for the new version of the @wordpress/eslint-plugin
won't be seamless.
Let's see which errors will still require some action after merging changes for Babel v7.16.0.
I will document those changes 👍 |
I landed #36244. Let’s see if rebasing is going to be enough to make all Continues Integration checks pass. |
I rebased this PR. I tried to debug the issue and they might be related to the following issues/PRs:
It seems like the testing failures arise from an interaction between Jest & the upgrade from ESLint from v7 to v8. I suspect that the following PR made to ESLint is the main culprit: eslint/eslint#14706 (since Jest does not seem to support the I could get the tests for the eslint-plugin to pass locally by adding an I also tried to upgrade ESLint to v8 on this branch: #33287 to eliminate the possibility of a possible incompatibility between ESLint v8 and Jest v26, but the tests also failed with the same error message as in the linked CI run at the top of this comment. |
It looks like there are some incompatible changes introduced between ESLint v8 and Jest v27 that will force us to update both tools at a similar time. I also encountered several issues when trying to upgrade Jest to v27, but I managed to resolve most of them. The only blocker is related to React Native so we need to wait until the Mobile team brings React Native to the more recent version. Do you think we will have to wait until Jest v27 is there before we can upgrade ESLint to v8? |
@gziolo I managed to solve the issue with the failing unit tests. However, the "Static Analysis" job is failing because of an uncommitted change to The job was failing earlier, then I ran npm install locally and committed the change: 920598e Now the job is failing with the exact same opposite diff. |
Great news! 🎉 Awesome work 👏
Yes, I’m seeing it a lot recently. We really need to upgrade to npm 8 once the next major WordPress release (5.9 is scheduled for January) is out. I think you can manually revert the changes in the lock file that get reported in the CI job. |
I guess we can land this PR pretty soon once the remaing issues/questions get addressed. |
I have removed prettier/react from the config since all configs were merged into each other. See changelog: https://github.com/prettier/eslint-config-prettier/blob/5a2f0e24382a8e1322784bc836d47706cccd2f1e/CHANGELOG.md#version-800-2021-02-21
Co-authored-by: Greg Ziółkowski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work with the ESLint upgrade. Everything looks good, and it seems to work correctly. Let’s land it as soon as Continuous Integration turns green.
It's now available for testing on npm with: npm install --save-dev @wordpress/eslint-plugin@next or npm install --save-dev @wordpress/scripts@next The stable version should be available in the second half of January. |
Description
Closes #35576.
@wordpress/eslint-plugin
@wordpress/scripts
Changelog: https://eslint.org/docs/user-guide/migrating-to-8.0.0
How has this been tested?
npm run lint
The parsing errors will most likely be gone once Babel Preset: Update Babel packages to 7.16 version #36244 is merged (the optional Babel plugin was enabled by default since 7.14, see Archive
@babel/plugin-syntax-class-properties
babel/babel#13232)I only just noticed that @gziolo was working on this, so some changes in this PR overlap with changes in #36244.
I will also add changelog entries before this gets merged.
Checklist:
*.native.js
files for terms that need renaming or removal).