Add support for ESLint 9 to @emotion/eslint-plugin
#3248
+1,840
−2,633
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
Adds support for ESLint 9 to
@emotion/eslint-plugin
.Closes #3211
Closes #3251
Why:
ESLint 9 contains breaking changes for plugins. We need to apply those changes, so that end-users may smoothly upgrade their projects to ESLint 9.
How:
I followed the upgrade guides for ESLint and TypeScript ESLint.
The plugin exports a
plugin
object for ESLint 9; the existingrules
export is also maintained. The plugin doesn't export configurations, so no changes were needed for flat config support.Some
context
methods were deprecated/removed in ESLint 9. The plugin uses the new methods when available, and falls back to the old methods when an older version of ESLint is in use.I had to migrate the base project's ESLint setup to v9, because Yarn was unhappy with two different ESLint versions in the monorepo.
The Node version in CI was bumped from 16.x to 20.x, to meet ESLint's minimum Node version requirement (it's 18.18.0+, but might as well use 20.x.) The Parcel bundler used for the benchmark script needed a minor version bump to fix Node 18+ compatibility.
Checklist: