emotion-js / emotion

👩‍🎤 CSS-in-JS library designed for high performance style composition
https://emotion.sh/
MIT License
17.5k stars 1.11k forks source link

Add support for ESLint 9 to `@emotion/eslint-plugin` #3248

Open soren121 opened 2 months ago

soren121 commented 2 months ago

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 existing rules 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:

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 940ed5d3245b6b8116b87a1c81727d9973bcd9d5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------------- | ----- | | @emotion/eslint-plugin | Minor |

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

codesandbox-ci[bot] commented 2 months ago

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.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.81%. Comparing base (ad630e3) to head (940ed5d). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
packages/eslint-plugin/src/rules/jsx-import.ts 88.23% 2 Missing :warning:
Additional details and impacted files | [Files with missing lines](https://app.codecov.io/gh/emotion-js/emotion/pull/3248?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=emotion-js) | Coverage Δ | | |---|---|---| | [...kages/eslint-plugin/src/rules/syntax-preference.ts](https://app.codecov.io/gh/emotion-js/emotion/pull/3248?src=pr&el=tree&filepath=packages%2Feslint-plugin%2Fsrc%2Frules%2Fsyntax-preference.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=emotion-js#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi9zcmMvcnVsZXMvc3ludGF4LXByZWZlcmVuY2UudHM=) | `91.96% <100.00%> (+0.14%)` | :arrow_up: | | [packages/eslint-plugin/src/utils.ts](https://app.codecov.io/gh/emotion-js/emotion/pull/3248?src=pr&el=tree&filepath=packages%2Feslint-plugin%2Fsrc%2Futils.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=emotion-js#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi9zcmMvdXRpbHMudHM=) | `100.00% <100.00%> (ø)` | | | [packages/eslint-plugin/test/test-utils.ts](https://app.codecov.io/gh/emotion-js/emotion/pull/3248?src=pr&el=tree&filepath=packages%2Feslint-plugin%2Ftest%2Ftest-utils.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=emotion-js#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi90ZXN0L3Rlc3QtdXRpbHMudHM=) | `100.00% <100.00%> (ø)` | | | [packages/eslint-plugin/src/rules/jsx-import.ts](https://app.codecov.io/gh/emotion-js/emotion/pull/3248?src=pr&el=tree&filepath=packages%2Feslint-plugin%2Fsrc%2Frules%2Fjsx-import.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=emotion-js#diff-cGFja2FnZXMvZXNsaW50LXBsdWdpbi9zcmMvcnVsZXMvanN4LWltcG9ydC50cw==) | `97.29% <88.23%> (-0.73%)` | :arrow_down: |
shunxing commented 3 weeks ago

Hi @soren121, do you have any update on this PR ?

soren121 commented 3 weeks ago

@shunxing Still waiting on the maintainers to take a look.

yunseyeong commented 2 weeks ago

💯