-
Notifications
You must be signed in to change notification settings - Fork 3
Upgrade ESLint to v9 and its related plugins to their latest major version #25
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades ESLint to version 9 and migrates the configuration to use Flat Config format, which is the new configuration system introduced in ESLint v8.21.0. The migration includes upgrading ESLint plugins to their latest major versions and converting the entire configuration structure from the legacy format to the new flat configuration format.
Key Changes:
- Upgraded ESLint from v8 to v9 and migrated all rule configurations to use Flat Config syntax
- Updated all ESLint plugins to their latest major versions (eslint-plugin-import, eslint-plugin-jsdoc, etc.)
- Converted configuration files from legacy .eslintrc.js format to eslint.config.js flat configuration format
Reviewed Changes
Copilot reviewed 32 out of 35 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/eslint-config/package.json | Updated peer dependencies to ESLint v9 and latest plugin versions |
| packages/eslint-config/rules/*.js | Converted all rule configuration files from legacy to flat config format |
| packages/eslint-config/base.js | Restructured base configuration to use flat config array format |
| packages/eslint-config/index.js | Updated main entry point to export flat config arrays |
| packages/eslint-config/eslint.config.js | Added flat configuration file for the package itself |
| packages/eslint-config/V2_MIGRATION.md | Added migration guide documenting breaking changes |
| packages/eslint-config/README.md | Updated documentation with flat config usage examples |
Comments suppressed due to low confidence (2)
packages/eslint-config/rules/@typescript-eslint.js:1
- [nitpick] The
caughtErrors: 'none'setting disables validation of catch block arguments, which could lead to unused error variables. Consider changing to'all'and uncommenting thecaughtErrorsIgnorePatternto maintain consistency with the pattern of requiring underscore prefixes for unused variables.
/* eslint-disable max-lines, max-len -- Required here due to many overrides */
packages/eslint-config/rules/@typescript-eslint.js:1
- [nitpick] The TODO comment indicates uncertainty about the
allowDirectConstAssertionInArrowFunctionssetting. This should be resolved by either setting it totruewith justification or removing the comment iffalseis the intended value.
/* eslint-disable max-lines, max-len -- Required here due to many overrides */
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…ersion (#380) ## High Level Overview of Change This PR has changes similar to XRPLF/xrpl.js#3075: 1. Update ESLint and its related plugins to their latest major versions. 2. Account for breaking changes introduced by ESLint v9 itself and other ESLint plugins and configs. 3. Update @xrplf/eslint-config to 2.0.0. See XRPLF/typescript-style#25 4. Update prettier from v2 to v3.6.2 5. eslint-plugin-jsdoc plugin does not support Node version 18. Updated CI to use 20.x, 22.x. Production [Docker file](https://github.com/xpring-eng/vhs-deploy/blob/main/Dockerfile) uses uses Node 20. <!-- Please include a summary/list of the changes. If too broad, please consider splitting into multiple PRs. If a relevant Asana task, please link it here. --> ### Context of Change The plugins and outdated ESLint dependencies from @xrplf/eslint-config was causing depandabot version update failures and many were piled up. This PR will resolve them. 1. Reduce number of vulnerabilities ``` Before: 27 vulnerabilities (1 low, 18 moderate, 6 high, 2 critical) After: 21 vulnerabilities (17 moderate, 4 high) ``` <!-- Please include the context of a change. If a bug fix, when was the bug introduced? What was the behavior? If a new feature, why was this architecture chosen? What were the alternatives? If a refactor, how is this better than the previous implementation? If there is a design document for this feature, please link it here. --> ### Type of Change <!-- Please check relevant options, delete irrelevant ones. --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] Refactor (non-breaking change that only restructures code) - [ ] Tests (You added tests for code that already exists, or your new feature included in this PR) - [ ] Documentation Updates - [ ] Release ## Before / After <!-- If just refactoring / back-end changes, this can be just an in-English description of the change at a technical level. If a UI change, screenshots should be included. --> ## Test Plan Unit, Integration and Linting should pass in CI. <!-- Please describe the tests that you ran to verify your changes and provide instructions so that others can reproduce. --> <!-- ## Future Tasks For future tasks related to PR. -->
Following are the changes introduced by this PR:
@xrplf/eslint-config@2.0.0.Following are the changes that are expected in
xrpl.jsandVHSto consume@xrplf/eslint-config@2.0.0once it's released.