-
Notifications
You must be signed in to change notification settings - Fork 639
Migrate to ESLint 9 #3118
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
Merged
Migrate to ESLint 9 #3118
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This bumps ESLint, the various ESLint configs, and related packages (Prettier, etc.) to a more recent version, matching the MetaMask ESLint configurations. This is the first step in the ESLint 9 migration, and does not yet fix any of the breaking changes. CI will not pass, but I will merge this into a feature branch and follow up with other PRs. Closes #3098.
This updates the LavaMoat build policy, following the dependency changes in #3096.
This updates the CLI and Webpack plugin to handle breaking changes following the bump required for ESLint 9. Unfortunately Prettier 3 makes it very complicated to load configuration files with CJS, since it loads the ESM bundle using a top-level await, which is not supported by Node.js without additional experimental parameters. For now I've removed the functionality for custom Prettier configs, but we can reconsider this in the future (i.e., through specifying a Prettier path in the CLI config, or allowing to provide the options directly).
This updates the lint workflow for ESLint 9. It seems easier/faster to run ESLint from the root, so I changed the lint job to only run once, rather than for every package.
This rewrites the existing ESLint config to the flat config format, with minimal modifications to the original config, other than those required by the new format. In addition to that, there are some other minor changes: - I updated the Prettier config to use Prettier 3. - I removed ESLint and related dependencies from all non-root workspace packages. These are no longer required, and removing them makes dependency maintenance a bit easier. Closes #3099.
This either replaces or removes inline comments disabling ESLint rules following the configuration changes in #3107 and rule changes in `@metamask/eslint-config`.
This fixes (most of) the remaining import rule violations: - import-x/no-named-as-default-member - import-x/no-duplicates - import-x/extensions - import-x/unambiguous - import-x/no-unresolved - import-x/no-nodejs-modules - import-x/namespace
This fixes the following lint rule violations: - @typescript-eslint/no-unused-vars - @typescript-eslint/prefer-nullish-coalescing - @typescript-eslint/switch-exhaustiveness-check - @typescript-eslint/no-base-to-string - @typescript-eslint/prefer-promise-reject-errors - @typescript-eslint/prefer-readonly - @typescript-eslint/no-floating-promises - @typescript-eslint/no-misused-promises - @typescript-eslint/await-thenable - @typescript-eslint/restrict-template-expressions - @typescript-eslint/unbound-method - @typescript-eslint/no-empty-object-type
This updates the ESLint configuration to fix errors related to Node.js and browser globals, and disables some rules that were too strict.
This fixes lint violations for the following rules: - jest/no-disabled-tests - jest/prefer-to-be - jest/prefer-to-have-length
This fixes the following lint violations: - jsdoc/check-param-names - jsdoc/tag-lines
This fixes a couple of minor issues after rebasing the `eslint-9` branch.
This fixes some tests that are failing after ESLint 9 changes, and updates example shasums.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3118 +/- ##
=======================================
Coverage 94.90% 94.90%
=======================================
Files 506 504 -2
Lines 11119 11119
Branches 1709 1708 -1
=======================================
+ Hits 10552 10553 +1
+ Misses 567 566 -1 ☔ View full report in Codecov by Sentry. |
david0xd
approved these changes
Feb 19, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature branch for the ESLint 9 migration.
Closes #3097.