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

[@wordpress/eslint-plugin] Support for ESlint v8 #35576

Closed
scinos opened this issue Oct 13, 2021 · 6 comments · Fixed by #36283
Closed

[@wordpress/eslint-plugin] Support for ESlint v8 #35576

scinos opened this issue Oct 13, 2021 · 6 comments · Fixed by #36283
Labels
Needs Dev Ready for, and needs developer efforts [Package] ESLint plugin /packages/eslint-plugin [Package] Scripts /packages/scripts
Projects

Comments

@scinos
Copy link
Contributor

scinos commented Oct 13, 2021

Description

ESlint v8 has been released and it includes a few breaking changes.

@wordpress/eslint-plugin should support it. At the very least it should:

  • Declare 8 as a valid peer dependency
  • Update 3rd party eslint-plugin-* dependencies to a version that supports ESLint v8

I haven't check if the provided rules must be updated as well to work in ESLint v8

Step-by-step reproduction instructions

N/A

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@marekdedic
Copy link
Contributor

Hi,
I initially got an error with something related to jest, now I'm getting

TypeError: Failed to load plugin '@typescript-eslint' declared in '.eslintrc.json » plugin:@wordpress/recommended': Class extends value undefined is not a constructor or null
Referenced from: /home/runner/work/crdm-modern/crdm-modern/node_modules/@wordpress/eslint-plugin/index.js
    at Object.<anonymous> (/home/runner/work/crdm-modern/crdm-modern/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js:12:34)
    at Module._compile (/home/runner/work/crdm-modern/crdm-modern/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (/home/runner/work/crdm-modern/crdm-modern/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/runner/work/crdm-modern/crdm-modern/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js:14:14)
    at Module._compile (/home/runner/work/crdm-modern/crdm-modern/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

Hope that helps, thanks!

@gziolo
Copy link
Member

gziolo commented Nov 11, 2021

@simonhammes is working on the upgrade in #36283 🎉

gziolo added a commit that referenced this issue Dec 3, 2021
* Update @typescript-eslint/eslint-plugin to ^5.3.0

* Update @typescript-eslint/parser to ^5.3.0

* Update eslint-plugin-jest to ^25.2.3

Changelog: https://github.com/jest-community/eslint-plugin-jest/blob/1cfded5a2744656227d7bf616d65ec12b7ddb287/CHANGELOG.md#2500-2021-10-10

* Update eslint-config-prettier to ^8.3.0

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

* Update eslint-plugin-jsdoc to ^37.0.3

Changelog: https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v37.0.0

* Update globals to ^13.12.0

Changelog: https://github.com/sindresorhus/globals/releases/tag/v13.0.0

* scripts: Update eslint to ^8.2.0

Changelog: https://eslint.org/docs/user-guide/migrating-to-8.0.0

* Document dependency updates in changelogs

* eslint-plugin: Update eslint-plugin-react-hooks to ^4.3.0

* eslint-plugin: Update eslint-plugin-react to ^7.27.0

* eslint-plugin: Update eslint-plugin-jsx-a11y to ^6.5.1

* Update package-lock.json

* scripts: Update eslint to ^8.3.0

* Add moduleNameMapper entry for @eslint/eslintrc

* eslint-plugin: Update eslint peer dependency constraint

* jest-preset-default: Add moduleNameMapper for ESLint

* Update packages/eslint-plugin/package.json

Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>

* Update package-lock.json

* Update CHANGELOG.md

Co-authored-by: Simon Hammes <simonhammes@users.noreply.github.com>
Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
@gziolo gziolo moved this from To do to Done in Core JS Dec 3, 2021
@ChristianMMacy
Copy link

ChristianMMacy commented Dec 9, 2021

Hello! Thank you for bumping the ESLint version. I see that the version is updated in TRUNK, but the current version on NPM is 9.3.0 and still has a peer dependency of ^6 | ^7. What does the release schedule look like for eslint-plugin? I.e. when will the current version be available via NPM?

If 9.3 should have the correct versions, I'd love help figuring out what might be going on that I keep getting the wrong peer dependency. (all my other packages that use eslint are on 8.4.1).

UPDATE: I noticed that the 36283 is schedule for Gutenberg 12.2, and I'm assuming that this package will get bumped at that time.

@gziolo
Copy link
Member

gziolo commented Dec 13, 2021

See: https://github.com/WordPress/gutenberg/blob/trunk/docs/contributors/code/release.md#synchronizing-wordpress-trunk

For each Gutenberg plugin release, WordPress trunk should be synchronized. Note that the WordPress trunk branch can be closed or in "feature-freeze" mode. Usually, this happens between the first beta and the first RC of the WordPress release cycle. During this period, the Gutenberg plugin releases should not be synchronized with WordPress Core.

We are in the process of releasing the next major WordPress version (5.9) so we don't do regular npm publishing every two weeks.

I plan to run the development release with the next dist-tag later this week in case someone wants to use the most recent version earlier.

@gziolo
Copy link
Member

gziolo commented Dec 20, 2021

It's now available for testing on npm with:

npm install --save-dev @wordpress/eslint-plugin@next

The stable version should be available in the second half of January.

@WraithKenny

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Dev Ready for, and needs developer efforts [Package] ESLint plugin /packages/eslint-plugin [Package] Scripts /packages/scripts
Projects
No open projects
Core JS
  
Done
Development

Successfully merging a pull request may close this issue.

6 participants