Skip to content

Migrate to ESLint 9 flat config format#424

Closed
Copilot wants to merge 6 commits intodependabot/npm_and_yarn/eslint-9.39.1from
copilot/sub-pr-423
Closed

Migrate to ESLint 9 flat config format#424
Copilot wants to merge 6 commits intodependabot/npm_and_yarn/eslint-9.39.1from
copilot/sub-pr-423

Conversation

Copy link

Copilot AI commented Nov 5, 2025

  • Analyze the issue - ESLint 9 requires migration to flat config
  • Create new eslint.config.js file with flat config format
  • Migrate all rules and plugins from .eslintrc.yml to flat config
  • Update the lint command in package.json
  • Add typescript-eslint package for proper flat config support
  • Simplified config to avoid type-checking issues
  • Remove legacy .eslintrc.yml file (no longer needed with ESLint 9)
  • Add @eslint/compat for legacy plugin compatibility
  • Wrap eslint-plugin-github with fixupPluginRules for ESLint 9 support
  • Add Jest globals for proper test environment support
  • Test the configuration with npm run lint
  • Address any remaining compatibility issues

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

✨ PR Description

Purpose: Migrate ESLint configuration from legacy .eslintrc.yml format to ESLint 9 flat config format for improved maintainability and compatibility.

Main changes:

  • Created new eslint.config.js using TypeScript-ESLint's config function with project-specific rules
  • Updated package.json with required dependencies (@eslint/js, @eslint/compat, typescript-eslint)
  • Simplified lint command and removed reference to legacy .github/linters/.eslintrc.yml
  • Maintained existing rule configurations while adapting to the new flat config structure

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

Co-authored-by: MishaKav <289035+MishaKav@users.noreply.github.com>
@MishaKav
Copy link
Collaborator

MishaKav commented Nov 5, 2025

@copilot is this file still in use .github/linters/.eslintrc.yml, should we leave it or remove it ?

@MishaKav MishaKav marked this pull request as ready for review November 5, 2025 11:27
Co-authored-by: MishaKav <289035+MishaKav@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 5, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • linearb.jfrog.io
    • Triggering command: npm ci (dns block)
    • Triggering command: npm install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update eslint from 8.57.1 to 9.39.1 Migrate to ESLint 9 flat config format Nov 5, 2025
Copilot AI requested a review from MishaKav November 5, 2025 11:30
Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

The PR successfully migrates from ESLint 8 to ESLint 9 using the new flat config format. The configuration structure follows ESLint 9 best practices, though there's a potential plugin compatibility concern.

1 issues detected:

🐞 Bug - Plugin rule spreading assumes flat config compatibility which may cause runtime errors if the plugin doesn't support the new format.

Details: The Jest plugin rules are being spread directly from the plugin's recommended configuration, which may not be compatible with ESLint 9's flat config format if the plugin version doesn't fully support it.
File: eslint.config.js (94-94)

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

Co-authored-by: MishaKav <289035+MishaKav@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 5, 2025

@copilot is this file still in use .github/linters/.eslintrc.yml, should we leave it or remove it ?

The .github/linters/.eslintrc.yml file is no longer used with ESLint 9's flat config. ESLint 9 automatically uses eslint.config.js and ignores legacy .eslintrc files. I've removed it to avoid confusion. See commit 59b836e.

Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

The migration to ESLint 9 flat config format is well-structured and follows the correct patterns, but there are potential gaps in plugin rule coverage that could affect linting consistency.

2 issues detected:

🐞 Bug - Important GitHub-specific linting rules may not be enforced due to missing plugin configuration

Details: The GitHub plugin is registered but the recommended rules from plugin:github/recommended are not being applied. The old configuration extended from plugin:github/recommended, but the new flat config only includes the plugin without applying its recommended ruleset.
File: eslint.config.js

🐞 Bug - Jest linting rules may not apply to JavaScript test files, leading to inconsistent code quality

Details: Jest plugin rules are only applied to TypeScript files (.ts), but Jest tests may also exist in JavaScript files (.js). This could result in inconsistent linting for JavaScript test files.
File: eslint.config.js (102-102)

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

@MishaKav
Copy link
Collaborator

MishaKav commented Nov 5, 2025

@copilot the ci is still failing in npm run lint, please make all changes and fixes

Copilot AI and others added 2 commits November 5, 2025 11:50
Co-authored-by: MishaKav <289035+MishaKav@users.noreply.github.com>
Co-authored-by: MishaKav <289035+MishaKav@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 5, 2025

@copilot the ci is still failing in npm run lint, please make all changes and fixes

I've fixed the ESLint 9 compatibility issues:

  1. Added @eslint/compat package to support legacy plugins (commit 8ec8198)
  2. Wrapped eslint-plugin-github with fixupPluginRules() since it doesn't natively support ESLint 9 flat config yet
  3. Added Jest environment globals for proper test support (commit 38e8da7)
  4. Added @eslint/js package explicitly

The configuration should now work with ESLint 9. The CI should pass once the dependencies are installed.

Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

The ESLint 9 flat config migration is well-structured overall, but there are some configuration issues that need to be addressed, particularly around Jest globals access and ensuring consistent linting across both TypeScript and JavaScript files.

2 issues detected:

🐞 Bug - Incorrect property path for accessing Jest globals will cause configuration errors

Details: The Jest globals are being accessed using an incorrect property path that will likely cause runtime errors. The nested property access pattern appears to be malformed.
File: eslint.config.js (34-34)

🧹 Maintainability - JavaScript test files lack Jest-specific linting configuration leading to inconsistent code quality

Details: JavaScript files don't have Jest plugin configuration, globals, or rules applied, which means JavaScript test files won't get proper Jest-specific linting and may have missing global variable definitions.
File: eslint.config.js (110-110)

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

tsconfigRootDir: __dirname
},
globals: {
...jestPlugin.environments.globals.globals
Copy link
Contributor

Choose a reason for hiding this comment

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

🐞 Bug - Invalid Jest Globals: Change the Jest globals access from ...jestPlugin.environments.globals.globals to the correct property path, likely ...jestPlugin.environments.globals or use a direct object with Jest globals.

Suggested change
...jestPlugin.environments.globals.globals
...jestPlugin.environments.globals
Is this review accurate? Use 👍 or 👎 to rate it

If you want to tell us more, use /gs feedback e.g. /gs feedback this review doesn't make sense, I disagree, and it keeps repeating over and over

{
files: ['**/*.js'],
...tseslint.configs.disableTypeChecked,
rules: {
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Maintainability - Missing Jest Configuration: Add Jest plugin, globals, and relevant Jest rules to the JavaScript files configuration section to ensure consistent test file linting across both TypeScript and JavaScript.

Suggested change
rules: {
languageOptions: {
globals: {
...jestPlugin.environments.globals.globals
}
},
plugins: {
jest: jestPlugin,
github: fixupPluginRules(githubPlugin),
prettier: prettierPlugin
},
rules: {
// ESLint core rules
'camelcase': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
'semi': ['error', 'never'],
'func-call-spacing': ['error', 'never'],
// Prettier integration
'prettier/prettier': 'error',
// GitHub plugin rules
'eslint-comments/no-use': 'off',
'eslint-comments/no-unused-disable': 'off',
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
// Jest plugin rules
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
Is this review accurate? Use 👍 or 👎 to rate it

If you want to tell us more, use /gs feedback e.g. /gs feedback this review doesn't make sense, I disagree, and it keeps repeating over and over

Copy link
Collaborator

Choose a reason for hiding this comment

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

/gs feedback this sugegstion is more then 30 lines, it very scare and hard to check

@MishaKav MishaKav closed this Nov 5, 2025
@MishaKav MishaKav deleted the copilot/sub-pr-423 branch November 5, 2025 12:23
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.

2 participants