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

Bump eslint to ^9.11.1 and migrate to flat config #4727

Merged
merged 22 commits into from
Jan 9, 2025

Conversation

MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Sep 24, 2024

Explanation

We recently released new versions of our ESLint packages to rely on ESLint 9. This PR bumps all of the ESLint-related packages in this repo to match, and migrates the current ESLint config into the new flat format. It also upgrades Prettier to v3.

References

Closes #4745.

Changelog

(N/A; developer-only change)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Copy link

socket-security bot commented Sep 24, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/[email protected] environment 0 33.2 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 66.5 kB nicolo-ribaudo
npm/@babel/[email protected] environment, filesystem, unsafe 0 794 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 546 kB nicolo-ribaudo
npm/@babel/[email protected] environment 0 53.5 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 63.7 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 161 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 31.8 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 48.3 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 11.8 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 863 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 1.9 MB nicolo-ribaudo
npm/@babel/[email protected] Transitive: environment +1 2.62 MB nicolo-ribaudo
npm/@babel/[email protected] Transitive: environment +1 716 kB nicolo-ribaudo
npm/@es-joy/[email protected] None 0 121 kB brettz9
npm/@eslint-community/[email protected] None +1 410 kB eslint-community-bot
npm/@eslint-community/[email protected] None 0 473 kB eslint-community-bot
npm/@eslint/[email protected] None 0 315 kB eslintbot
npm/@eslint/[email protected] None 0 60 kB eslintbot
npm/@eslint/[email protected] filesystem, unsafe Transitive: environment +4 1.45 MB eslintbot
npm/@eslint/[email protected] None 0 14.9 kB eslintbot, openjsfoundation
npm/@eslint/[email protected] None 0 57 kB eslintbot
npm/@eslint/[email protected] None 0 77.1 kB eslintbot
npm/@humanfs/[email protected] None 0 72.7 kB nzakas
npm/@humanfs/[email protected] None +1 89.5 kB nzakas
npm/@humanwhocodes/[email protected] None 0 64.9 kB nzakas
npm/@jest/[email protected] None 0 6.07 kB simenb
npm/@metamask/[email protected] None +1 215 kB metamaskbot
npm/@metamask/[email protected] Transitive: environment, filesystem +2 283 kB metamaskbot
npm/@metamask/[email protected] None 0 12.2 kB metamaskbot
npm/@metamask/[email protected] unsafe 0 98.4 kB metamaskbot
npm/@metamask/[email protected] None 0 22.7 kB metamaskbot
npm/@metamask/[email protected] unsafe +1 307 kB metamaskbot
npm/@nolyfill/[email protected] unsafe 0 2.71 kB sukkaw
npm/@sinclair/[email protected] None 0 442 kB sinclair
npm/@types/[email protected] None 0 8.49 kB types
npm/@typescript-eslint/[email protected] None 0 2.79 MB bradzacher, jameshenry
npm/@typescript-eslint/[email protected] None 0 18.9 kB bradzacher, jameshenry
npm/@typescript-eslint/[email protected] None 0 626 kB bradzacher, jameshenry
npm/@typescript-eslint/[email protected] None 0 127 kB bradzacher, jameshenry
npm/@typescript-eslint/[email protected] None 0 174 kB bradzacher, jameshenry
npm/@typescript-eslint/[email protected] None 0 594 kB bradzacher, jameshenry
npm/@typescript-eslint/[email protected] None 0 288 kB bradzacher, jameshenry
npm/@typescript-eslint/[email protected] None 0 19.6 kB bradzacher, jameshenry
npm/[email protected] None 0 547 kB marijn
npm/[email protected] None 0 13.6 kB joshuakgoldberg
npm/[email protected] None 0 64.9 kB ai
npm/[email protected] None 0 2.15 MB caniuse-lite
npm/[email protected] None 0 366 kB yavorskiys
npm/[email protected] None 0 154 kB kilianvalkhof
npm/[email protected] None 0 212 kB evilebottnawi, jhnns, sokra, ...1 more
npm/[email protected] None 0 91.3 kB guybedford
npm/[email protected] filesystem 0 12.4 kB lukeed
npm/[email protected] filesystem 0 53.1 kB ota-meshi
npm/[email protected] None 0 20.8 kB lydell
npm/[email protected] None 0 52.6 kB jounqin
npm/[email protected] None 0 409 kB eslint-community-bot
npm/[email protected] None +1 790 kB jounqin
npm/[email protected] None 0 350 kB aaronabramov, jeysal, jsonp, ...6 more
npm/[email protected] filesystem +1 2.1 MB gajus
npm/[email protected] None 0 461 kB eslint-community-bot, weiran.zsd
npm/[email protected] None 0 34.3 kB jounqin
npm/[email protected] None 0 96.6 kB eslint-community-bot
npm/[email protected] None 0 152 kB eslintbot
npm/[email protected] None 0 36.1 kB eslintbot
npm/[email protected] environment Transitive: filesystem +6 3.42 MB eslintbot
npm/[email protected] filesystem 0 98.4 kB mrmlnc
npm/[email protected] filesystem 0 16 kB jaredwray
npm/[email protected] filesystem 0 29.3 kB jaredwray
npm/[email protected] filesystem 0 105 kB hirokiosame
npm/[email protected] None 0 11.8 kB sunset_techuila
npm/[email protected] None 0 245 kB jsdoc-type-pratt-parser
npm/[email protected] None 0 32.3 kB mathias
npm/[email protected] None 0 6.72 kB styfle
npm/[email protected] None 0 37.2 kB chicoxyzzy
npm/[email protected] None 0 39.1 kB tomeraberbach
npm/[email protected] None 0 6.37 kB alexeyraspopov
npm/[email protected] None 0 15 kB hirokiosame
npm/[email protected] None 0 26 kB chrisackerman
npm/[email protected] None 0 5.46 kB quietshu
npm/[email protected] environment 0 59.8 kB jounqin
npm/[email protected] None 0 46.9 kB sokra
npm/[email protected] None 0 353 kB joshuakgoldberg
npm/[email protected] None 0 103 kB jameshenry
npm/[email protected] None 0 14.7 kB ai

🚮 Removed packages: npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@es-joy/[email protected], npm/@eslint-community/[email protected], npm/@eslint-community/[email protected], npm/@eslint/[email protected], npm/@eslint/[email protected], npm/@humanwhocodes/[email protected], npm/@humanwhocodes/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@types/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@ungap/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link

socket-security bot commented Sep 24, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@nolyfill/[email protected]

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@MajorLift MajorLift force-pushed the jongsun/preview/240924-eslint9 branch 2 times, most recently from bf0f6eb to a680d66 Compare September 24, 2024 17:06
@MajorLift MajorLift force-pushed the jongsun/preview/240924-eslint9 branch from a680d66 to 792cf47 Compare September 24, 2024 17:09
@MajorLift MajorLift force-pushed the jongsun/preview/240924-eslint9 branch from 235f317 to 86311e7 Compare September 24, 2024 17:14
@MajorLift MajorLift changed the title [DNM] preview/eslint9 Bump eslint to ^9.11.1 and migrate to flat config Sep 30, 2024
@MajorLift MajorLift self-assigned this Sep 30, 2024
@mcmire
Copy link
Contributor

mcmire commented Dec 4, 2024

Updated to latest stable release of @metamask/eslint-config and friends. The lint pipeline now works but tests are failing.

@mcmire
Copy link
Contributor

mcmire commented Dec 4, 2024

@SocketSecurity ignore npm/@nolyfill/[email protected]

This is coming from eslint-import-resolver-typescript, which @metamask/eslint-config-typescript requires. We can't really control this.

@mcmire mcmire self-assigned this Dec 4, 2024
@mcmire mcmire marked this pull request as ready for review December 4, 2024 22:07
@mcmire mcmire requested review from a team as code owners December 4, 2024 22:07
@mcmire mcmire requested a review from a team as a code owner December 11, 2024 16:30
Copy link
Contributor Author

@MajorLift MajorLift left a comment

Choose a reason for hiding this comment

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

Everything LGTM! Thanks for getting this to the finish line :)

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Approving on behalf of Jongsun.

@mcmire mcmire enabled auto-merge (squash) January 9, 2025 16:50
@mcmire mcmire merged commit 3535d58 into main Jan 9, 2025
120 checks passed
@mcmire mcmire deleted the jongsun/preview/240924-eslint9 branch January 9, 2025 16:51
PatrykLucka pushed a commit that referenced this pull request Jan 13, 2025
We recently released new versions of our ESLint packages to rely on
ESLint 9. This PR bumps all of the ESLint-related packages in this repo
to match, and migrates the current ESLint config into the new flat
format. It also upgrades Prettier to v3.

---------

Co-authored-by: Elliot Winkler <[email protected]>
brianacnguyen pushed a commit to MetaMask/metamask-design-system that referenced this pull request Jan 29, 2025
## Description

This PR implements a major update to our ESLint configuration and
related dependencies, migrating to ESLint 9.0.0 and adopting the new
flat configuration format. This change aligns with the recent updates in
our core repository and addresses multiple dependency updates that were
pending through Dependabot.

Key improvements:
1. Migration to ESLint 9's flat configuration format using
`eslint.config.mjs`
2. Removal of legacy `.eslintrc.js` files across packages
3. Consolidation of ESLint configurations
4. Update of all ESLint-related dependencies to their latest versions

This PR resolves [issue
#285](#285) and
consolidates the following Dependabot PRs:
- [#280](#280) -
@metamask/eslint-config-typescript upgrade
- [#279](#279) -
@metamask/eslint-config-jest upgrade
- [#275](#275) -
@metamask/eslint-config-nodejs upgrade
- [#274](#274) -
@metamask/eslint-config upgrade

## Related issues

Fixes: #285

## Manual testing steps

1. Pull down the branch
2. Run `yarn` to update dependencies
3. Run `yarn lint` to verify ESLint runs successfully
4. Run `yarn changelog:validate` to verify auto changelog runs
successfully
5. Verify that ESLint rules are being properly enforced in your editor
6. Test across all packages to ensure linting works as expected

## Screenshots/Recordings



https://github.com/user-attachments/assets/95877c2b-c0da-4eae-9f34-a75626bec9da



## Pre-merge author checklist

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [x] I've completed the PR template
- [x] I've included tests (linting configuration tests)
- [x] I've documented configuration changes
- [x] I've applied appropriate labels

## References

- [Core Repository
Implementation](MetaMask/core#4727)
- [ESLint 9.0.0 Migration
Guide](https://eslint.org/docs/latest/use/migrate-to-9.0.0)
- [ESLint Configuration Migration
Guide](https://eslint.org/docs/latest/use/configure/migration-guide)

## Pre-merge reviewer checklist

- [ ] I've manually tested the PR
- [ ] I confirm that this PR addresses all acceptance criteria
- [ ] I've verified that linting works correctly across all packages
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 config format is deprecated
5 participants