-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add support for ESLint 9 to @emotion/eslint-plugin
#3248
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 940ed5d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
/** @jsx jsx */ | ||
import * as emotion from '@emotion/react' | ||
let ele = <div css={\`color:hotpink;\`} /> | ||
let ele = <div css={{}} /> | ||
`.trim(), | ||
errors: [ | ||
{ | ||
messageId: 'cssPropWithPragma' | ||
} | ||
], | ||
output: ` | ||
/** @jsx jsx */ | ||
/** @jsx emotion.jsx */ | ||
import * as emotion from '@emotion/react' | ||
let ele = <div css={\`color:hotpink;\`} /> |
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.
With TypeScript-ESLint 8's RuleTester, this causes an error due to overlapping fixes for cssPropWithPragma
and templateLiterals
. The new RuleTester tries to apply fixes for all errors, not just the first encountered.
To fix this, I split it into two tests, one for each fix.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
@emotion/eslint-plugin
@emotion/eslint-plugin
@emotion/eslint-plugin
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
Hi @soren121, do you have any update on this PR ? |
@shunxing Still waiting on the maintainers to take a look. |
💯 |
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Setup Node.js 16.x | ||
uses: actions/setup-node@v3 | ||
- name: Setup Node.js 20.x |
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.
yesterday, Node LTS Version is updated to 22, is it ok?
https://nodejs.org/en/about/previous-releases
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: