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

chore: updated ESLint to v9 with flat config #7032

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Sep 6, 2024

Description

Bumps ESLint to v9 and migrates the ESLint config from the legacy "eslintrc" format (apps/site/.eslintrc.json) to the new "flat" format (apps/site/eslint.config.js). This brought a few complications 🙃...

This also butted into some pre-existing issues:

The lines of ESLint config code are about the same if we ignore temporary flat config compatibility layers and disables for transient issues:

  • main: ~120 (~100 .eslintrc.json + ~20 .eslintignore)
  • eslint-9: ~120 (~150 eslint.config.js - ~25 compat lines - ~5 transient disables)

Validation

Broadly, npm run lint. Specifically, npm run lint:js and npm run lint:md from apps/site.

I also verified performance isn't worse in this PR. It's actually a little better! Using time npm run + lint:js or lint:md, ignoring Turbo caches, on an M1 Max Mac Studio...

Files main eslint-9
lint:js ~10s ~5s
lint:md ~55s ~55s

Related Issues

Parallel to #6991.

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run format to ensure the code follows the style guide.
  • I have run npm run test to check if all tests are passing.
  • I have run npx turbo build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@JoshuaKGoldberg JoshuaKGoldberg requested review from a team as code owners September 6, 2024 13:50
Copy link

vercel bot commented Sep 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Sep 6, 2024 2:05pm

Copy link
Collaborator

@bmuenzenmeyer bmuenzenmeyer left a comment

Choose a reason for hiding this comment

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

Working locally on my machine (Windows 10)
Thanks so much for this work @JoshuaKGoldberg

Copy link

github-actions bot commented Sep 6, 2024

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 92%
90.54% (594/656) 76.29% (177/232) 94.57% (122/129)

Unit Test Report

Tests Skipped Failures Errors Time
131 0 💤 0 ❌ 0 🔥 5.158s ⏱️

Copy link
Contributor

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for giving time on that !

@ovflowd
Copy link
Member

ovflowd commented Sep 6, 2024

With all due respect, can I just hug you, Josh?!! Thank you so much for this contribution! Very very much appreciated 😭

Copy link
Member

@canerakdas canerakdas left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@shanpriyan shanpriyan left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@bmuenzenmeyer bmuenzenmeyer added this pull request to the merge queue Sep 9, 2024
Merged via the queue into nodejs:main with commit 0b3e391 Sep 9, 2024
14 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the eslint-9 branch September 9, 2024 10:41
joeeames pushed a commit to joeeames/nodejs.org that referenced this pull request Sep 24, 2024
* chore: updated ESLint to v9 with flat config

* chore: missed an .eslintjscache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants