Skip to content

Conversation

@Patel-Raj11
Copy link
Collaborator

@Patel-Raj11 Patel-Raj11 commented Aug 11, 2025

Following are the changes introduced by this PR:

  1. Upgrade ESLint to v9 and now exports Flat configs that were first introduced in v8.21.0 of ESLint.
  2. Upgrade various ESLint plugins used by this shared config to their latest major version and account for their breaking changes.
  3. Add V2_MIGRATION.md file to list the migration steps and breaking changes.
  4. Update typescript-style repo itself to use Flat configs (i.e. use eslint.config.js file) for it's own linting.
  5. Update README with installation and usage guide for @xrplf/eslint-config@2.0.0.

Following are the changes that are expected in xrpl.js and VHS to consume @xrplf/eslint-config@2.0.0 once it's released.

  1. XRPLF/xrpl.js@main...eslint-v9-migration
  2. ripple/validator-history-service@main...eslint-v9-migration

@kuan121 kuan121 requested review from Copilot and kuan121 September 8, 2025 21:52
Copy link

Copilot AI left a 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 the caughtErrorsIgnorePattern to 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 allowDirectConstAssertionInArrowFunctions setting. This should be resolved by either setting it to true with justification or removing the comment if false is 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.

@Patel-Raj11 Patel-Raj11 merged commit adfc247 into XRPLF:master Sep 11, 2025
2 checks passed
Patel-Raj11 added a commit to ripple/validator-history-service that referenced this pull request Sep 17, 2025
…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.
-->
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.

3 participants