Skip to content

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented Jun 23, 2025

This will allow to upgrade eslint to v9.

Summary by CodeRabbit

  • Chores
    • Updated ESLint configuration to use a new modular setup for improved code quality and style consistency.
    • Removed legacy ESLint configuration and ignore files.
    • Adjusted dependency management to reflect ESLint changes and streamline updates.

This will allow to upgrade eslint to v9.
@tbouffard tbouffard added dependencies skip-changelog Do not include in Changelog and Release Notes javascript Pull requests that update Javascript code labels Jun 23, 2025
Copy link

coderabbitai bot commented Jun 23, 2025

Walkthrough

This change removes the old ESLint configuration files and introduces a new modular ESLint setup using eslint.config.mjs. It updates dependency management in package.json and .github/dependabot.yml to align with the new ESLint and TypeScript ESLint package structure, and removes the .eslintignore file.

Changes

File(s) Change Summary
.eslintignore, .eslintrc.json Removed legacy ESLint ignore and configuration files.
eslint.config.mjs Added new modular ESLint configuration with TypeScript and Prettier integration.
package.json Replaced @typescript-eslint/* packages with typescript-eslint in devDependencies.
.github/dependabot.yml Removed ignore rule for "eslint" and updated lint group patterns for dependency updates.

Possibly related PRs

  • maxGraph/maxGraph#630: Modifies .github/dependabot.yml by removing an ignore rule for "eslint" and adjusting lint group patterns, targeting the same configuration file.
  • maxGraph/maxGraph#629: Updates .github/dependabot.yml with JavaScript dependency configuration, including ignore lists and grouping patterns, directly related to dependency management changes.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-23T12_21_42_902Z-debug-0.log

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@tbouffard tbouffard added chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) and removed dependencies skip-changelog Do not include in Changelog and Release Notes javascript Pull requests that update Javascript code labels Jun 23, 2025
@tbouffard tbouffard marked this pull request as ready for review June 23, 2025 12:20
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
eslint.config.mjs (1)

54-58: Consider implementing the recommended import plugin configuration.

The TODO comment indicates plans to add importPlugin.flatConfigs.recommended. This would provide additional import-related rules beyond the basic plugin registration.

Consider replacing the current import plugin setup with the recommended configuration:

-  // TODO configure import with more rules by adding "importPlugin.flatConfigs.recommended"
-  {
-    plugins: {
-      import: importPlugin, // may no longer be needed whe loading recommended config of import plugin
-    },
+  importPlugin.flatConfigs.recommended,
+  {

This would provide better import validation while maintaining the custom rules below.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 685714e and 5caeaec.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .eslintignore (0 hunks)
  • .eslintrc.json (0 hunks)
  • .github/dependabot.yml (1 hunks)
  • eslint.config.mjs (1 hunks)
  • package.json (1 hunks)
💤 Files with no reviewable changes (2)
  • .eslintignore
  • .eslintrc.json
🔇 Additional comments (7)
package.json (1)

29-30: LGTM! Dependency consolidation aligns with flat config migration.

The migration from separate @typescript-eslint/eslint-plugin and @typescript-eslint/parser packages to the consolidated typescript-eslint package is the correct approach for ESLint flat configuration. This consolidation simplifies dependency management while maintaining full functionality.

.github/dependabot.yml (1)

46-49: LGTM! Dependabot patterns updated to match new package structure.

The pattern updates correctly reflect the dependency changes in package.json. Replacing @typescript-eslint/* with eslint and adding typescript-eslint ensures proper grouping of lint-related dependencies under the new consolidated package structure.

eslint.config.mjs (5)

1-21: LGTM! Proper license header and modern imports.

The Apache 2.0 license header is correctly included, and the imports use the modern flat config approach with appropriate packages:

  • @eslint/js for base configuration
  • eslint-plugin-import for import rules
  • eslint-plugin-prettier/recommended for Prettier integration
  • typescript-eslint for the consolidated TypeScript ESLint package

24-36: LGTM! Comprehensive ignore patterns replace .eslintignore.

The ignore patterns appropriately cover:

  • IDE folders (.github, .idea, .vscode)
  • Build outputs (dist, lib, build)
  • Generated files and dependencies (node_modules, coverage, generated)

This effectively replaces the functionality of the removed .eslintignore file.


42-49: LGTM! Proper JavaScript configuration with type-checking disabled.

The JavaScript-specific configuration correctly:

  • Targets JS files with appropriate extensions
  • Disables TypeScript type-checking for JS files using tsEslint.configs.disableTypeChecked
  • Sets ECMAScript 2020 parsing with module support
  • Uses modern language options structure

60-89: LGTM! Well-balanced custom rule configuration.

The custom rules strike a good balance:

  • Appropriate warnings: no-misleading-character-class, no-dupe-else-if
  • Sensible disables: no-warning-comments (reasonable for active development), various TypeScript strict rules that may be too restrictive
  • Important restrictions: no-console, no-eval, const enum prohibition for interoperability
  • Practical allowances: Short-circuit and ternary expressions in no-unused-expressions

The const enum restriction with a clear message is particularly well-implemented for maintaining JavaScript interoperability.


92-93: LGTM! Prettier integration correctly positioned last.

The Prettier recommended configuration is correctly positioned as the final configuration to avoid conflicts with other formatting rules. The comment clearly explains the importance of this ordering.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
eslint.config.mjs (1)

54-58: Address the TODO for import plugin configuration.

The TODO comment indicates incomplete import plugin setup. Consider either implementing the recommended import plugin configuration or creating a follow-up issue to address this.

Would you like me to generate the recommended import plugin configuration or open an issue to track this enhancement?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 685714e and 5caeaec.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .eslintignore (0 hunks)
  • .eslintrc.json (0 hunks)
  • .github/dependabot.yml (1 hunks)
  • eslint.config.mjs (1 hunks)
  • package.json (1 hunks)
💤 Files with no reviewable changes (2)
  • .eslintignore
  • .eslintrc.json
🔇 Additional comments (7)
package.json (2)

29-30: LGTM! Dependency consolidation aligns with flat config.

The migration from separate @typescript-eslint/eslint-plugin and @typescript-eslint/parser packages to the unified typescript-eslint package is correct for the flat configuration format.


24-24: Verify ESLint version alignment with PR objectives.

The PR objectives mention that this change enables upgrading ESLint to version 9, but package.json still specifies ESLint ~8.57.1. Please confirm if the ESLint 9 upgrade is intended as part of this PR or in a subsequent change.

#!/bin/bash
# Check if ESLint 9 is compatible with the current flat config setup
npm view eslint versions --json | jq '.[-5:]'
eslint.config.mjs (4)

17-20: LGTM! Imports correctly set up for flat config.

The imports properly utilize the new unified typescript-eslint package and follow flat config patterns.


78-86: LGTM! Custom const enum restriction is well-implemented.

The custom rule to forbid const enums with a clear message promotes better interoperability. This is a good practice for library code.


92-92: LGTM! Prettier integration correctly positioned.

Placing the Prettier configuration last ensures it properly overrides conflicting rules, which is the recommended approach.


24-36: Let's broaden the search scope to catch any deeper build or temp directories:

#!/bin/bash
# Remove depth limit to find all matching directories across the repo
fd -t d . | grep -E "(build|dist|coverage|tmp|temp|cache)" | head -20
.github/dependabot.yml (1)

46-49: LGTM! Dependabot patterns updated correctly.

The lint group patterns properly reflect the new dependency structure, replacing the wildcard @typescript-eslint/* pattern with explicit entries for eslint and typescript-eslint. This ensures proper grouping of related linting dependency updates.

@tbouffard tbouffard merged commit d9289c2 into main Jun 23, 2025
7 checks passed
@tbouffard tbouffard deleted the chore/eslint_migrate_to_flat_config branch June 23, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant