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

feat(plugin-eslint): add support for flat config and v9 #880

Merged
merged 16 commits into from
Nov 23, 2024
Merged

Conversation

matejchalk
Copy link
Collaborator

@matejchalk matejchalk commented Nov 22, 2024

Closes #875

  • The @code-pushup/eslint-plugin now supports ESLint v9 and the flat config format.
  • The format is autodetected from process.env.ESLINT_USE_FLAT_CONFIG and ESLint.version.
  • The config path is optional, the default configuration is discovered using a new findNearestFile utility function.
  • Dropped support for inline config object, which wasn't documented or used anyway. The reason is the new format isn't serializable as JSON anymore.
  • E2E tested both config formats.
  • Also tested manually (installed via Verdaccio registry) in external Nx example project using ESLint 9 combined with new version of @code-pushup/eslint-config.
  • This repo still uses ESLint 8 (blocked by Nx migration), which serves to verify the plugin still works with v8 via Code PushUp job in CI.

Copy link

github-actions bot commented Nov 22, 2024

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared target commit 569fa22 with source commit dee46b3.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🟡 51 🔴 49 ↓ −2.7
Code coverage 🟡 90 🟢 90 ↑ +0.2
Custom checks 🟡 67 🟡 67
Security 🟡 73 🟡 73
Updates 🟡 76 🟡 76
Accessibility 🟢 91 🟢 91
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Bug prevention 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 1 group improved, 👎 1 group regressed, 👍 5 audits improved, 👎 2 audits regressed, 13 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🟡 51 🔴 49 ↓ −2.7
Code coverage Code coverage metrics 🟡 90 🟢 90 ↑ +0.2

18 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟥 Root document took 660 ms 🟩 Root document took 430 ms ↓ −35.6 %
Lighthouse Speed Index 🟥 6.3 s 🟥 7.3 s ↑ +16.3 %
Lighthouse First Contentful Paint 🟥 3.1 s 🟨 2.8 s ↓ −9.6 %
Lighthouse Largest Contentful Paint 🟨 3.3 s 🟨 3.6 s ↑ +8.9 %
Code coverage Function coverage 🟩 92.4 % 🟩 92.7 % ↑ +0.3 %
Code coverage Branch coverage 🟨 84.8 % 🟨 85 % ↑ +0.3 %
Code coverage Line coverage 🟩 90.4 % 🟩 90.5 % ↑ +0.1 %
Lighthouse Minimizes main-thread work 🟥 20.2 s 🟥 21.9 s ↑ +8 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,821 KiB 🟩 Total size was 1,820 KiB ↓ −0.1 %
Lighthouse Total Blocking Time 🟥 7,560 ms 🟥 8,430 ms ↑ +11.5 %
Lighthouse Time to Interactive 🟥 17.8 s 🟥 17.0 s ↓ −4.3 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −4.3 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 1,730 ms 🟥 Potential savings of 990 ms ↓ −42.8 %
Lighthouse JavaScript execution time 🟥 11.0 s 🟥 10.4 s ↓ −5.6 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 82 KiB 🟥 Potential savings of 57 KiB ↓ −68.1 %
Lighthouse Uses efficient cache policy on static assets 🟨 28 resources found 🟨 28 resources found ↓ −0.1 %
Lighthouse Server Backend Latencies 🟩 110 ms 🟩 190 ms ↑ +74.4 %
Lighthouse Network Round Trip Times 🟩 10 ms 🟩 70 ms ↑ +375.7 %
Lighthouse Max Potential First Input Delay 🟥 2,910 ms 🟥 2,900 ms ↓ −0.2 %
Lighthouse Avoids an excessive DOM size 🟥 2,250 elements 🟥 2,247 elements ↓ −0.1 %

493 other audits are unchanged.

@matejchalk matejchalk marked this pull request as ready for review November 22, 2024 11:40
Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the upgrade!

@matejchalk matejchalk merged commit 3db30da into main Nov 23, 2024
16 checks passed
@matejchalk matejchalk deleted the flat-config branch November 23, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESLint 9 (flat config) support for Code PushUp plugin
3 participants