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

refactor: update eslint to flat config for all projects #892

Merged
merged 14 commits into from
Dec 17, 2024
Merged

Conversation

matejchalk
Copy link
Collaborator

@matejchalk matejchalk commented Dec 13, 2024

Updated everything to do with ESLint and fixed related issues.

  • Updated ESLint, plugins and shared config to latest version.
  • Updated all projects to flat config format.
  • All ESLint configs are in ESM, except for the Nx plugin which enforces CommonJS (solved with --experimental-require-module).
  • Fix all lint problems from new config and removed unused disable comments.
    • Most changes are from unicorn/import-style, which started enforcing default imports from node:path (e.g. path.join instead of plain join).
      • Nx plugin has to use import * as path from 'node:path' because it's in CommonJS.
  • Updated ESLint plugin's integration test fixtures to new format.
  • Fixed a bug which was uncovered in new version regarding how ESLint config resolves default options for the new format (caused mismatched audit slugs because of options hash).

Copy link

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared target commit 13a38d6 with source commit cec4a73.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Updates 🟡 75 🟡 80 ↑ +5.4
Performance 🟡 50 🟡 55 ↑ +4.6
Code coverage 🟢 91 🟢 91 ↓ −0.1
Security 🟡 81 🟡 81
Accessibility 🟢 91 🟢 91
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Bug prevention 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 2 groups improved, 👎 1 group regressed, 👍 7 audits improved, 👎 3 audits regressed, 12 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JS Packages NPM outdated dependencies 🟡 75 🟡 80 ↑ +5.4
Lighthouse Performance 🟡 50 🟡 55 ↑ +4.6
Code coverage Code coverage metrics 🟢 91 🟢 91 ↓ −0.1

14 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Speed Index 🟥 7.3 s 🟨 5.5 s ↓ −24.9 %
JS Packages Outdated NPM dev dependencies. 🟨 52 outdated package versions (32 major, 15 minor, 5 patch) 🟨 41 outdated package versions (24 major, 11 minor, 6 patch) ↓ −21.2 %
Lighthouse Largest Contentful Paint 🟨 3.4 s 🟨 3.1 s ↓ −8.6 %
Lighthouse Time to Interactive 🟥 16.0 s 🟥 12.7 s ↓ −20.3 %
JS Packages Outdated NPM prod dependencies. 🟨 11 outdated package versions (5 major, 5 minor, 1 patch) 🟨 11 outdated package versions (4 major, 6 minor, 1 patch)  +0 %
Lighthouse First Contentful Paint 🟨 2.8 s 🟨 2.9 s ↑ +3.6 %
Lighthouse Total Blocking Time 🟥 7,230 ms 🟥 3,710 ms ↓ −48.7 %
Code coverage Line coverage 🟩 91.1 % 🟩 90.9 % ↓ −0.2 %
Code coverage Function coverage 🟩 93.3 % 🟩 93.1 % ↓ −0.1 %
Code coverage Branch coverage 🟨 85.7 % 🟨 85.7 % ↑ +0.1 %
Lighthouse Minimizes main-thread work 🟥 20.3 s 🟥 14.2 s ↓ −30.2 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −20.3 %
Lighthouse JavaScript execution time 🟥 9.0 s 🟥 6.8 s ↓ −25 %
Lighthouse Max Potential First Input Delay 🟥 2,700 ms 🟥 1,370 ms ↓ −49.2 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 520 ms 🟥 Potential savings of 1,270 ms ↑ +146.8 %
Lighthouse Uses efficient cache policy on static assets 🟨 28 resources found 🟨 28 resources found ↑ +0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,817 KiB 🟩 Total size was 1,817 KiB ↑ +0.1 %
Lighthouse Initial server response time was short 🟩 Root document took 500 ms 🟩 Root document took 440 ms ↓ −11.6 %
Lighthouse Server Backend Latencies 🟩 120 ms 🟩 110 ms ↓ −10.8 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 67 KiB 🟥 Potential savings of 67 KiB ↓ −3.2 %
Lighthouse Network Round Trip Times 🟩 10 ms 🟩 20 ms ↑ +84.7 %
Lighthouse Avoids an excessive DOM size 🟥 2,163 elements 🟥 2,162 elements ↓ −0.1 %

438 other audits are unchanged.

@matejchalk matejchalk marked this pull request as ready for review December 16, 2024 17:23
@matejchalk matejchalk requested a review from vmasek December 16, 2024 17:23
@matejchalk matejchalk merged commit 284f755 into main Dec 17, 2024
17 checks passed
@matejchalk matejchalk deleted the eslint-update branch December 17, 2024 09:44
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.

2 participants