Skip to content

ci: phase-1 eslint hardening with flat config#92

Merged
Mehdi-Bl merged 3 commits into
mainfrom
ci-17-eslint-phase1
Feb 12, 2026
Merged

ci: phase-1 eslint hardening with flat config#92
Mehdi-Bl merged 3 commits into
mainfrom
ci-17-eslint-phase1

Conversation

@Mehdi-Bl

@Mehdi-Bl Mehdi-Bl commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • migrate ESLint to flat config (eslint.config.js)
  • enable phase-1 lint improvements: React hooks, Jest plugin baseline, import ordering for src/**, and unused-import cleanup
  • remove legacy ESLINT_USE_FLAT_CONFIG=false usage from lint scripts
  • align ESLint runtime with flat config by upgrading eslint to ^9.39.2
  • fix react-hooks/exhaustive-deps finding in App with an explicit mount-only suppression rationale for the stable preload bridge reference
  • remove deprecated Prettier option (jsxBracketSameLine)
  • retire legacy .eslintignore (renamed to .eslintignore.legacy) to avoid ESLint 9 migration warnings

Scope choices

  • keep scripts/** excluded from lint in this phase to avoid dev-tooling noise
  • apply import/order only to src/** for low-churn rollout
  • relax a few noisy Jest rules for current suite patterns (expect-expect, no-conditional-expect, no-standalone-expect)

Validation

  • npm run lint
  • npm test -- --runInBand
  • npm run sonar ⚠️ blocked locally by Vault/Sonar auth (HTTP 401 Unauthorized)

Notes

  • two unrelated untracked workflow files in local workspace were intentionally excluded from this PR.

Summary by CodeRabbit

  • Chores
    • Updated linting and formatting toolchain and scripts; added modern ESLint plugins and rules.
  • Style
    • Removed an explicit Prettier option and applied import/formatting cleanups across the codebase.
  • Refactor
    • Internal code reorganizations for cleaner imports and centralized internal API access (no behavior changes).

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sourcery-ai

sourcery-ai Bot commented Feb 12, 2026

Copy link
Copy Markdown

Reviewer's Guide

Migrates ESLint to the new flat config with stricter linting (React hooks, Jest, import ordering, unused imports), updates lint/test tooling wiring, and makes small code tweaks to satisfy new rules, including stabilizing the electron API reference and normalizing import ordering.

Flow diagram for ESLint flat config layers and targets

flowchart TD
  base[js_configs_recommended]

  ignores["Global ignores (node_modules, dist, build, coverage, scripts, bundles)"]

  js_ts_common["JS/TS common rules (src, tests)\n- globals: browser, node\n- unused-imports/no-unused-imports"]

  imports_order["Import ordering (src JS/TS)\n- import/order"]

  react_cfg["React and hooks (all JSX/TSX)\n- react recommended\n- react_hooks rules"]

  ts_cfg["TypeScript rules (all TS/TSX)\n- @typescript-eslint recommended\n- no_unused_vars, no_explicit_any overrides"]

  jest_cfg["Jest rules (tests, __tests__, *.test, *.spec)\n- jest recommended\n- noisy rules relaxed"]

  files_src["src/**/*.{js,jsx,ts,tsx}"]
  files_tests["tests/**/*.{js,jsx,ts,tsx}"]
  files_jsx_tsx["**/*.{jsx,tsx}"]
  files_ts_tsx["**/*.{ts,tsx}"]
  files_jest["tests/**, __tests__/**, *.test.*, *.spec.*"]

  base --> js_ts_common
  js_ts_common --> files_src
  js_ts_common --> files_tests

  files_src --> imports_order
  imports_order --> imports_src["src import ordering enforced"]

  files_jsx_tsx --> react_cfg
  files_ts_tsx --> ts_cfg

  files_jest --> jest_cfg

  ignores -. excludes .-> files_src
  ignores -. excludes .-> files_tests
Loading

File-Level Changes

Change Details Files
Adopt ESLint flat config with scoped rule sets for src, tests, TypeScript, React, Jest, and unused imports.
  • Introduce eslint.config.js using @eslint/js, @typescript-eslint, react, react-hooks, jest, import, and unused-imports plugins
  • Configure global ignores for build artifacts, bundles, and scripts
  • Define language options and globals for browser, node, and Jest contexts
  • Add rule sets for import ordering, React hooks correctness, TypeScript linting, Jest tests, and unused import enforcement, with a few noisy Jest rules relaxed
eslint.config.js
Tighten lint commands and dev dependencies to use the flat config and enforce zero warnings.
  • Update lint and lint:tests npm scripts to drop ESLINT_USE_FLAT_CONFIG flag, rely on flat config, and add --max-warnings 0
  • Adjust lint-staged to run Prettier first on text assets and ESLint --fix on source/test files
  • Add new ESLint-related devDependencies for flat config (core rules, plugins, parser, globals) and update package-lock.json accordingly
package.json
package-lock.json
Stabilize electronAPI reference in App component to satisfy React hooks and lint rules.
  • Introduce a local electronAPI variable derived from the global window typed as electronAPI
  • Use electronAPI instead of appWindow.electronAPI in config and directory tree loading logic
  • Add electronAPI to the useEffect dependency array to comply with exhaustive-deps
src/renderer/components/App.tsx
Normalize import ordering and grouping across selected TypeScript/React files to satisfy new lint rules.
  • Reorder value imports and type imports into separated groups with a blank line between them
  • Ensure external modules are listed before internal paths
  • Apply import spacing tweaks in several renderer, main, and utils modules without changing runtime behavior
src/utils/content-processor.ts
src/utils/file-analyzer.ts
src/main/updater.ts
src/main/feature-flags.ts
src/utils/filter-utils.ts
src/renderer/components/SourceTab.tsx
src/utils/config-manager.ts
src/renderer/components/DarkModeToggle.tsx
src/renderer/components/FileTree.tsx
src/renderer/components/ProcessedTab.tsx
src/renderer/components/TabBar.tsx
src/renderer/index.tsx
src/utils/secret-scanner.ts
src/__tests__/ConfigTab.test.tsx
src/main/index.ts
src/main/preload.ts
src/renderer/components/ConfigTab.tsx
Clean up Prettier configuration by removing a deprecated option.
  • Drop jsxBracketSameLine from Prettier config to avoid warnings with newer Prettier versions
prettier.config.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Review Summary by Qodo

Migrate ESLint to flat config with phase-1 rule hardening

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Migrate ESLint to flat config format with phase-1 rule hardening
• Enable React hooks, Jest plugin, import ordering, and unused-import rules
• Reorganize imports across codebase to follow new import ordering rules
• Remove legacy ESLint environment variable and deprecated Prettier option
• Add new ESLint plugin dependencies for enhanced linting coverage
Diagram
flowchart LR
  A["Legacy ESLint Config"] -->|"Migrate to Flat Config"| B["eslint.config.js"]
  B -->|"Enable Plugins"| C["React Hooks<br/>Jest<br/>Import Order<br/>Unused Imports"]
  D["Source Files"] -->|"Reorganize Imports"| E["Grouped & Ordered Imports"]
  F["package.json"] -->|"Add Dependencies"| G["@eslint/js<br/>eslint-plugin-import<br/>eslint-plugin-jest<br/>globals"]
  H["Prettier Config"] -->|"Remove Deprecated"| I["jsxBracketSameLine Removed"]
Loading

Grey Divider

File Changes

1. eslint.config.js ⚙️ Configuration changes +130/-0

Create new flat ESLint configuration file

eslint.config.js


2. package.json Dependencies +10/-5

Update lint scripts and add ESLint dependencies

package.json


3. prettier.config.js ⚙️ Configuration changes +0/-1

Remove deprecated jsxBracketSameLine option

prettier.config.js


View more (18)
4. src/main/feature-flags.ts Formatting +3/-1

Reorganize imports with proper grouping

src/main/feature-flags.ts


5. src/main/index.ts Formatting +14/-10

Reorganize imports by type and source

src/main/index.ts


6. src/main/preload.ts Formatting +1/-0

Add blank line after import statement

src/main/preload.ts


7. src/main/updater.ts Formatting +3/-2

Reorganize imports with type imports last

src/main/updater.ts


8. src/utils/config-manager.ts Formatting +2/-0

Add blank lines between import groups

src/utils/config-manager.ts


9. src/utils/content-processor.ts Formatting +5/-3

Reorganize imports with proper grouping

src/utils/content-processor.ts


10. src/utils/file-analyzer.ts Formatting +4/-2

Reorganize imports with type imports last

src/utils/file-analyzer.ts


11. src/utils/filter-utils.ts Formatting +3/-1

Reorganize imports with proper grouping

src/utils/filter-utils.ts


12. src/utils/secret-scanner.ts Formatting +1/-0

Add blank line after import statement

src/utils/secret-scanner.ts


13. src/__tests__/ConfigTab.test.tsx Formatting +2/-1

Reorganize imports following new ordering rules

src/tests/ConfigTab.test.tsx


14. src/renderer/components/App.tsx Formatting +15/-11

Reorganize imports and extract electronAPI variable

src/renderer/components/App.tsx


15. src/renderer/components/ConfigTab.tsx Formatting +3/-1

Reorganize imports with proper grouping

src/renderer/components/ConfigTab.tsx


16. src/renderer/components/DarkModeToggle.tsx Formatting +1/-0

Add blank line after import statement

src/renderer/components/DarkModeToggle.tsx


17. src/renderer/components/FileTree.tsx Formatting +1/-0

Add blank line after import statement

src/renderer/components/FileTree.tsx


18. src/renderer/components/ProcessedTab.tsx Formatting +1/-0

Add blank line after import statement

src/renderer/components/ProcessedTab.tsx


19. src/renderer/components/SourceTab.tsx Formatting +2/-0

Reorganize imports with proper grouping

src/renderer/components/SourceTab.tsx


20. src/renderer/components/TabBar.tsx Formatting +1/-0

Add blank line after import statement

src/renderer/components/TabBar.tsx


21. src/renderer/index.tsx Formatting +1/-0

Add blank line after import statements

src/renderer/index.tsx


Grey Divider

Qodo Logo

@coderabbitai

coderabbitai Bot commented Feb 12, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Mehdi-Bl has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 34 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds a new flat ESLint configuration and updates lint scripts/devDependencies; removes one Prettier option; and makes non-functional import reordering/formatting edits across many source files, plus small local refactors in the renderer App to centralize electronAPI usage.

Changes

Cohort / File(s) Summary
ESLint config & tooling
eslint.config.js, package.json
Adds eslint.config.js (flat config) and updates package.json lint scripts; upgrades ESLint and adds plugins (@eslint/js, eslint-plugin-import, eslint-plugin-jest, eslint-plugin-unused-imports, globals).
Prettier
prettier.config.js
Removes explicit jsxBracketSameLine: false option (rely on Prettier default).
Renderer — small refactor
src/renderer/components/App.tsx
Centralizes appWindow.electronAPI into an electronAPI variable and replaces repeated calls; adds an ESLint disable comment for exhaustive-deps; no behavioral changes.
Import/formatting tidy (renderer & tests)
src/__tests__/ConfigTab.test.tsx, src/renderer/index.tsx, src/renderer/components/{DarkModeToggle,FileTree,ProcessedTab,SourceTab,TabBar}.tsx, src/renderer/components/ConfigTab.tsx
Whitespace and import ordering adjustments (blank lines, minor import reorders); no logic changes.
Import/formatting tidy (main & utils)
src/main/{feature-flags,index,preload,updater}.ts, src/utils/{config-manager,content-processor,file-analyzer,filter-utils,secret-scanner}.ts
Reordered/grouped imports, converted some to type-only imports, added a getErrorMessage import in updater.ts; no runtime behaviour changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through imports, neat and spry,

Linted the meadow, gave rules a try.
Config in paw, scripts all aligned,
A tidy repo, peaceful and kind. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: phase-1 eslint hardening with flat config' directly and accurately describes the main change: migrating ESLint to flat config with phase-1 hardening improvements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci-17-eslint-phase1

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @Mehdi-Bl, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the project's code quality tooling by migrating ESLint to its modern flat configuration. This change introduces a more robust and maintainable linting setup, enabling stricter rules for React hooks, Jest tests, and import statements. The update aims to improve code consistency, catch potential issues earlier, and streamline the development workflow without introducing excessive noise, focusing on a gradual rollout of new rules.

Highlights

  • ESLint Flat Configuration Migration: The project's ESLint setup has been migrated to the new flat configuration system, modernizing the linting infrastructure.
  • Enhanced Linting Rules: Phase-1 lint improvements have been enabled, including React hooks rules, a Jest plugin baseline, import ordering for source files, and cleanup of unused imports.
  • Script Modernization: Legacy cross-env ESLINT_USE_FLAT_CONFIG=false usage has been removed from lint scripts in package.json.
  • Dependency Updates: Numerous ESLint-related packages and other dependencies have been updated or added to support the new linting configuration.
  • Prettier Configuration Update: A deprecated jsxBracketSameLine option was removed from the Prettier configuration.
  • Codebase Refactoring for Linting Compliance: Imports across various source files have been reordered to comply with the newly enforced import/order rule, and the electronAPI reference in App.tsx was stabilized to address a no-undef finding.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • eslint.config.js
    • Added new ESLint flat configuration file, defining rules for JavaScript, React, TypeScript, and Jest environments.
    • Configured unused-imports plugin to error on unused imports.
    • Implemented import/order rule for consistent import grouping and alphabetization.
    • Enabled recommended rules for React and React Hooks, while disabling react/react-in-jsx-scope and react/prop-types.
    • Applied recommended TypeScript ESLint rules, delegating unused variable checks to TypeScript and disabling no-undef, no-require-imports, and no-explicit-any.
    • Integrated recommended Jest ESLint rules, with specific rules like no-console, expect-expect, no-conditional-expect, and no-standalone-expect turned off.
  • package-lock.json
    • Updated and added various ESLint-related dependencies, including @eslint/js, eslint-plugin-import, eslint-plugin-jest, eslint-plugin-unused-imports, and globals.
    • Updated versions for existing dependencies and added new transitive dependencies.
  • package.json
    • Modified the lint script to remove cross-env ESLINT_USE_FLAT_CONFIG=false and --ext flags, adapting to the new flat config.
    • Updated the lint:tests script to remove cross-env ESLINT_USE_FLAT_CONFIG=false and --ext flags, and added --max-warnings 0.
    • Reordered entries in the lint-staged configuration.
    • Added new development dependencies: @eslint/js, eslint-plugin-import, eslint-plugin-jest, eslint-plugin-unused-imports, and globals.
  • prettier.config.js
    • Removed the deprecated jsxBracketSameLine option from the Prettier configuration.
  • src/tests/ConfigTab.test.tsx
    • Reordered import statements to comply with new linting rules.
  • src/main/feature-flags.ts
    • Reordered import statements to comply with new linting rules.
  • src/main/index.ts
    • Reordered import statements to comply with new linting rules.
  • src/main/preload.ts
    • Reordered import statements to comply with new linting rules.
  • src/main/updater.ts
    • Reordered import statements to comply with new linting rules.
  • src/renderer/components/App.tsx
    • Reordered import statements to comply with new linting rules.
    • Stabilized the electronAPI reference by assigning appWindow.electronAPI to a constant electronAPI.
  • src/renderer/components/ConfigTab.tsx
    • Reordered import statements to comply with new linting rules.
  • src/renderer/components/DarkModeToggle.tsx
    • Reordered import statements to comply with new linting rules.
  • src/renderer/components/FileTree.tsx
    • Reordered import statements to comply with new linting rules.
  • src/renderer/components/ProcessedTab.tsx
    • Reordered import statements to comply with new linting rules.
  • src/renderer/components/SourceTab.tsx
    • Reordered import statements to comply with new linting rules.
  • src/renderer/components/TabBar.tsx
    • Reordered import statements to comply with new linting rules.
  • src/renderer/index.tsx
    • Reordered import statements to comply with new linting rules.
  • src/utils/config-manager.ts
    • Reordered import statements to comply with new linting rules.
  • src/utils/content-processor.ts
    • Reordered import statements to comply with new linting rules.
  • src/utils/file-analyzer.ts
    • Reordered import statements to comply with new linting rules.
  • src/utils/filter-utils.ts
    • Reordered import statements to comply with new linting rules.
  • src/utils/secret-scanner.ts
    • Reordered import statements to comply with new linting rules.
Activity
  • The lint script was executed, including format:check, eslint src tests --cache --max-warnings 0, lint:md, test:catalog, and changelog:validate, all passing successfully.
  • The format:check script confirmed all matched files use Prettier code style.
  • Markdown linting (lint:md:links and lint:md:style) passed, checking 15 markdown files and 8 links/images.
  • Test catalog validation passed with 30 references and 28 discovered tests.
  • Changelog validation passed for CHANGELOG.md.
  • The test script using Jest passed with no tests.
  • A SonarQube scan was initiated, generating a fresh Jest coverage report, but was blocked locally by Vault/Sonar authentication issues.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new flat config uses @eslint/js 9.x features while eslint in package.json is still pinned to 8.x; consider bumping eslint to a compatible 9.x version so that the flat config and js.configs.recommended are officially supported and behave consistently across environments.
  • In App.tsx, electronAPI is derived from globalThis but added as a dependency to the useEffect hook; if this reference is effectively static at runtime, consider wrapping it in useMemo or suppressing the exhaustive-deps rule locally to avoid implying that the effect depends on dynamic state.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new flat config uses `@eslint/js` 9.x features while `eslint` in package.json is still pinned to 8.x; consider bumping `eslint` to a compatible 9.x version so that the flat config and `js.configs.recommended` are officially supported and behave consistently across environments.
- In `App.tsx`, `electronAPI` is derived from `globalThis` but added as a dependency to the `useEffect` hook; if this reference is effectively static at runtime, consider wrapping it in `useMemo` or suppressing the exhaustive-deps rule locally to avoid implying that the effect depends on dynamic state.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

github-actions Bot commented Feb 12, 2026

Copy link
Copy Markdown

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ✅ 0 package(s) with unknown licenses.
See the Details below.

Scanned Files

  • package-lock.json

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the ESLint configuration to the new flat config format, which is a great improvement for maintainability. The new configuration is well-structured and enables several useful linting rules for React, Jest, and import ordering. The fix for the react-hooks/exhaustive-deps warning is also correct.

I've found a couple of areas for improvement in the new eslint.config.js file. One is a potential issue with JSX parsing for .jsx files, and the other is a minor redundancy in the TypeScript configuration. My detailed comments are below.

Comment thread eslint.config.js
Comment on lines +63 to +81
{
files: ['**/*.{jsx,tsx}'],
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...reactPlugin.configs.recommended.rules,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
},
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The current configuration for JSX/TSX files might not enable JSX parsing for .jsx files, as the ecmaFeatures: { jsx: true } is only set within the TypeScript-specific configuration block. This could lead to parsing errors for .jsx files.

To ensure JSX is parsed correctly for all relevant files, you should add languageOptions to this block.

  {
    files: ['**/*.{jsx,tsx}'],
    languageOptions: {
      parserOptions: {
        ecmaFeatures: {
          jsx: true,
        },
      },
    },
    plugins: {
      react: reactPlugin,
      'react-hooks': reactHooksPlugin,
    },
    settings: {
      react: {
        version: 'detect',
      },
    },
    rules: {
      ...reactPlugin.configs.recommended.rules,
      'react-hooks/rules-of-hooks': 'error',
      'react-hooks/exhaustive-deps': 'error',
      'react/react-in-jsx-scope': 'off',
      'react/prop-types': 'off',
    },
  },

Comment thread eslint.config.js
Comment on lines +87 to +88
ecmaVersion: 2022,
sourceType: 'module',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The ecmaVersion and sourceType options are already defined in the global configuration block for these files (lines 30-38). You can remove them here to avoid redundancy.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Feb 12, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

✅ 1. @eslint/js major mismatch 🐞 Bug ⛯ Reliability
Description
eslint.config.js requires top-level @eslint/js, but the repo still uses ESLint 8.57.1 (which depends
on @eslint/js 8.57.1). This dual-major setup can cause ESLint to load an incompatible recommended
ruleset or fail at runtime when initializing lint.
Code

eslint.config.js[R1-30]

+const js = require('@eslint/js');
+const globals = require('globals');
+const importPlugin = require('eslint-plugin-import');
+const jestPlugin = require('eslint-plugin-jest');
+const reactPlugin = require('eslint-plugin-react');
+const reactHooksPlugin = require('eslint-plugin-react-hooks');
+const tsPlugin = require('@typescript-eslint/eslint-plugin');
+const tsParser = require('@typescript-eslint/parser');
+const unusedImportsPlugin = require('eslint-plugin-unused-imports');
+
+module.exports = [
+  {
+    ignores: [
+      'node_modules/**',
+      'dist/**',
+      'build/**',
+      'coverage/**',
+      'scripts/**',
+      'src/renderer/bundle.js',
+      'src/renderer/bundle.js.map',
+      'src/renderer/bundle.js.LICENSE.txt',
+      'src/renderer/index.js',
+      'src/renderer/index.js.map',
+      'src/renderer/index.js.LICENSE.txt',
+      'src/renderer/output.css',
+    ],
+  },
+  js.configs.recommended,
+  {
+    files: ['src/**/*.{js,jsx,ts,tsx}', 'tests/**/*.{js,jsx,ts,tsx}'],
Evidence
The flat config explicitly imports @eslint/js and uses js.configs.recommended, so runtime will
resolve the top-level @eslint/js dependency. The lockfile shows ESLint 8.57.1 depends on @eslint/js
8.57.1, while the repo installs @eslint/js 9.39.2 at the top level, creating a major-version
mismatch for the config source.

eslint.config.js[1-30]
package.json[145-183]
package-lock.json[2635-2647]
package-lock.json[9749-9762]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`eslint.config.js` imports `@eslint/js`, but the repo installs `@eslint/js@9.x` while ESLint itself is `8.57.1` (and depends on `@eslint/js@8.57.1`). This major-version mismatch can break lint startup or yield unexpected rule compatibility.
## Issue Context
- Flat config explicitly uses `const js = require(&amp;#x27;@eslint/js&amp;#x27;)` and `js.configs.recommended`.
- `package-lock.json` shows ESLint 8.57.1 expects `@eslint/js@8.57.1`, but top-level `@eslint/js@9.39.2` is present.
## Fix Focus Areas
- eslint.config.js[1-30]
- package.json[145-183]
- package-lock.json[2635-2647]
- package-lock.json[9749-9762]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Legacy ESLint configs linger 🐞 Bug ⛯ Reliability
Description
The repo now has both flat config (eslint.config.js) and legacy configs (.eslintrc.js,
tests/.eslintrc.js) while the lint scripts no longer explicitly control which config system is used.
If flat-config loading fails (e.g., due to dependency mismatch) or editors/tools select legacy
configs, lint behavior may diverge across environments.
Code

package.json[R20-26]

+    "lint": "npm run format:check && eslint src tests --cache --max-warnings 0 && npm run lint:md && npm run test:catalog && npm run changelog:validate",
   "lint:md": "npm run lint:md:links && npm run lint:md:style",
   "lint:md:links": "node scripts/lint-markdown-links.js",
   "lint:md:style": "markdownlint \"**/*.{md,mdx}\" --config .markdownlint.json --ignore node_modules --ignore dist",
   "changelog:validate": "node scripts/validate-changelog.js",
-    "lint:tests": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint tests --ext .js,.jsx,.ts,.tsx --cache",
+    "lint:tests": "eslint tests --cache --max-warnings 0",
   "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,html,css}\"",
Evidence
Lint scripts now call eslint directly (no longer forcing legacy mode), while the repo still
contains legacy .eslintrc files in addition to the new eslint.config.js. Keeping both configuration
systems increases the chance of inconsistent linting depending on how ESLint/editor tooling resolves
config, especially if the flat config cannot load.

package.json[18-26]
.eslintrc.js[1-35]
tests/.eslintrc.js[1-14]
eslint.config.js[11-32]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The migration introduces `eslint.config.js` but leaves `.eslintrc.js` and `tests/.eslintrc.js` in place, and lint scripts no longer explicitly control config mode. This can lead to inconsistent lint results across environments if tooling falls back to legacy config or flat-config loading fails.
## Issue Context
- Lint scripts now run `eslint` directly.
- Both flat and legacy configs exist simultaneously.
## Fix Focus Areas
- package.json[18-26]
- eslint.config.js[11-32]
- .eslintrc.js[1-35]
- tests/.eslintrc.js[1-14]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread eslint.config.js
Comment on lines +1 to +30
const js = require('@eslint/js');
const globals = require('globals');
const importPlugin = require('eslint-plugin-import');
const jestPlugin = require('eslint-plugin-jest');
const reactPlugin = require('eslint-plugin-react');
const reactHooksPlugin = require('eslint-plugin-react-hooks');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const unusedImportsPlugin = require('eslint-plugin-unused-imports');

module.exports = [
{
ignores: [
'node_modules/**',
'dist/**',
'build/**',
'coverage/**',
'scripts/**',
'src/renderer/bundle.js',
'src/renderer/bundle.js.map',
'src/renderer/bundle.js.LICENSE.txt',
'src/renderer/index.js',
'src/renderer/index.js.map',
'src/renderer/index.js.LICENSE.txt',
'src/renderer/output.css',
],
},
js.configs.recommended,
{
files: ['src/**/*.{js,jsx,ts,tsx}', 'tests/**/*.{js,jsx,ts,tsx}'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. @eslint/js major mismatch 🐞 Bug ⛯ Reliability

eslint.config.js requires top-level @eslint/js, but the repo still uses ESLint 8.57.1 (which depends
on @eslint/js 8.57.1). This dual-major setup can cause ESLint to load an incompatible recommended
ruleset or fail at runtime when initializing lint.
Agent Prompt
## Issue description
`eslint.config.js` imports `@eslint/js`, but the repo installs `@eslint/js@9.x` while ESLint itself is `8.57.1` (and depends on `@eslint/js@8.57.1`). This major-version mismatch can break lint startup or yield unexpected rule compatibility.

## Issue Context
- Flat config explicitly uses `const js = require('@eslint/js')` and `js.configs.recommended`.
- `package-lock.json` shows ESLint 8.57.1 expects `@eslint/js@8.57.1`, but top-level `@eslint/js@9.39.2` is present.

## Fix Focus Areas
- eslint.config.js[1-30]
- package.json[145-183]
- package-lock.json[2635-2647]
- package-lock.json[9749-9762]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@eslint.config.js`:
- Around line 1-9: Legacy .eslintrc.js files are taking precedence over the new
flat config in eslint.config.js so your new rules (see symbols like js,
tsParser, importPlugin, jestPlugin, reactPlugin) aren’t applied; delete the
legacy .eslintrc.js files (root and tests/.eslintrc.js) from the repo, commit
that removal, and re-run the linter/CI to ensure eslint.config.js is now picked
up and the new flat config rules are enforced.

In `@package.json`:
- Around line 20-25: The lint pipeline fails because package.json pins "eslint"
to ^8.56.0 while the repo uses a flat config and an incompatible plugin version;
either upgrade ESLint to v9 (bump "eslint" to a 9.x release in devDependencies
so eslint.config.js is supported and keep existing lint scripts like "lint" /
"lint:tests"), or keep ESLint 8 and make two changes: downgrade
"eslint-plugin-unused-imports" to a 3.x release and prepend ES
LINT_USE_FLAT_CONFIG=true to the npm lint scripts (e.g., the "lint" and
"lint:tests" scripts) so the flat config is enabled at runtime; update
package.json devDependencies and the "lint" / "lint:tests" script entries
accordingly.

Comment thread eslint.config.js
Comment on lines +1 to +9
const js = require('@eslint/js');
const globals = require('globals');
const importPlugin = require('eslint-plugin-import');
const jestPlugin = require('eslint-plugin-jest');
const reactPlugin = require('eslint-plugin-react');
const reactHooksPlugin = require('eslint-plugin-react-hooks');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const unusedImportsPlugin = require('eslint-plugin-unused-imports');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

echo "=== ESLint and `@eslint/js` versions in package.json ==="
cat package.json | grep -A 50 '"devDependencies"' | grep -E '"eslint|@eslint/js' | head -10

echo ""
echo "=== Lint scripts in package.json ==="
cat package.json | grep -A 5 '"lint"'

echo ""
echo "=== Check entire scripts section ==="
cat package.json | grep -A 20 '"scripts"'

echo ""
echo "=== Search for ESLINT_USE_FLAT_CONFIG ==="
grep -r 'ESLINT_USE_FLAT_CONFIG' . --include='*.json' --include='*.js' --include='*.sh' 2>/dev/null || echo "Not found"

echo ""
echo "=== Lock file type and ESLint versions ==="
if [ -f "package-lock.json" ]; then
  echo "Found package-lock.json"
  grep -A 5 '"eslint"' package-lock.json | head -20
elif [ -f "yarn.lock" ]; then
  echo "Found yarn.lock"
  grep -A 5 'eslint' yarn.lock | head -20
fi

Repository: codingworkflow/ai-code-fusion

Length of output: 3384


🏁 Script executed:

#!/bin/bash

echo "=== Check for legacy ESLint config files ==="
find . -maxdepth 2 -name '.eslintrc*' -o -name '.eslintrc' 2>/dev/null | head -20

echo ""
echo "=== Check if eslint.config.js exists ==="
ls -la eslint.config.js 2>/dev/null || echo "File not found"

echo ""
echo "=== Check actual resolved ESLint version in node_modules ==="
if [ -d "node_modules/eslint" ]; then
  cat node_modules/eslint/package.json | grep '"version"' | head -1
else
  echo "ESLint not installed in node_modules"
fi

echo ""
echo "=== Check `@typescript-eslint` peer dependency requirement ==="
cat package-lock.json | grep -A 10 '@typescript-eslint/eslint-plugin' | grep -A 5 'peerDependencies' | head -15

Repository: codingworkflow/ai-code-fusion

Length of output: 716


🏁 Script executed:

#!/bin/bash

echo "=== Check lock file for resolved ESLint version ==="
cat package-lock.json | grep -A 3 '"eslint": {' | grep '"version"' | head -1

echo ""
echo "=== Check `@typescript-eslint/eslint-plugin` peerDependencies ==="
cat package-lock.json | grep -B 5 '@typescript-eslint/eslint-plugin' | grep -A 15 '"peerDependencies"' | head -20

echo ""
echo "=== List the legacy .eslintrc.js files ==="
echo "1. Root .eslintrc.js:"
head -5 .eslintrc.js
echo ""
echo "2. tests/.eslintrc.js:"
head -5 tests/.eslintrc.js

echo ""
echo "=== Check if both configs exist and what's in eslint.config.js ==="
echo "eslint.config.js first few lines:"
head -15 eslint.config.js

Repository: codingworkflow/ai-code-fusion

Length of output: 1867


🏁 Script executed:

#!/bin/bash

echo "=== Check if this is a migration or dual-config situation ==="
echo "Checking git history for eslint config files..."
git log --oneline --all -- '.eslintrc.js' 'eslint.config.js' 2>/dev/null | head -20

echo ""
echo "=== Full content of root .eslintrc.js ==="
cat .eslintrc.js

echo ""
echo "=== Full content of tests/.eslintrc.js ==="
cat tests/.eslintrc.js

echo ""
echo "=== ESLint auto-detection support in different versions ==="
echo "ESLint 8.57+ auto-detects eslint.config.js"
echo "ESLint 8.56 requires ESLINT_USE_FLAT_CONFIG=true"
echo "ESLint 9+ uses flat config by default"
echo ""
echo "Package.json declares: eslint ^8.56.0 (allows 8.56.0 through <9.0.0)"

Repository: codingworkflow/ai-code-fusion

Length of output: 2582


🏁 Script executed:

#!/bin/bash

echo "=== Check ESLint behavior with dual configs ==="
echo "ESLint precedence: .eslintrc.* (legacy) > eslint.config.js (flat)"
echo ""
echo "Current state:"
echo "1. Legacy .eslintrc.js exists: YES"
echo "2. Legacy tests/.eslintrc.js exists: YES"
echo "3. Flat eslint.config.js exists: YES"
echo "4. ESLINT_USE_FLAT_CONFIG in scripts: NO"
echo "5. ESLint version range: ^8.56.0 (8.56.0 to <9.0.0)"
echo ""
echo "=== Determining which config will actually be used ==="
echo "With ESLint 8.56-8.56.x: .eslintrc.js (legacy) - flat config ignored unless ESLINT_USE_FLAT_CONFIG=true"
echo "With ESLint 8.57+: auto-detects eslint.config.js, but .eslintrc.js still takes precedence"
echo "With ESLint 9+: eslint.config.js by default, but .eslintrc.js still takes precedence if present"
echo ""
echo "CONCLUSION: Legacy .eslintrc.js will be used regardless of ESLint version."
echo "The new eslint.config.js will be IGNORED."

echo ""
echo "=== Check if PR intended to replace or migrate configs ==="
git show 8ac13b2 --stat 2>/dev/null | head -30

Repository: codingworkflow/ai-code-fusion

Length of output: 2607


🏁 Script executed:

#!/bin/bash

echo "=== Verify that old .eslintrc.js was NOT deleted in the commit ==="
git show 8ac13b2 --name-only | grep -E '\.eslintrc|eslint\.config' | head -20

echo ""
echo "=== Check if .eslintrc.js was modified or added ==="
git show 8ac13b2 -- .eslintrc.js | head -50

echo ""
echo "=== Check what the diff shows for .eslintrc.js ==="
git diff 8ac13b2^..8ac13b2 -- .eslintrc.js | head -100

Repository: codingworkflow/ai-code-fusion

Length of output: 1485


🏁 Script executed:

#!/bin/bash

echo "=== Confirm ESLint config precedence behavior ==="
echo "According to ESLint docs, when both .eslintrc.* and eslint.config.js exist,"
echo "ESLint will use .eslintrc.* and ignore eslint.config.js"
echo ""

echo "=== Show which config files exist ==="
echo "Legacy configs (will be used):"
ls -la .eslintrc.js tests/.eslintrc.js 2>/dev/null

echo ""
echo "Flat config (will be IGNORED):"
ls -la eslint.config.js

echo ""
echo "=== Verify commit intention ==="
git log --oneline --all -5 | head -10
</script>

Repository: codingworkflow/ai-code-fusion

Length of output: 1015


🏁 Script executed:

#!/bin/bash

echo "=== Web search verification: ESLint config precedence ==="
echo "According to official ESLint documentation:"
echo "When both eslint.config.js (flat config) and .eslintrc.* (legacy config) exist,"
echo "ESLint will prefer .eslintrc.* and ignore eslint.config.js"
echo ""
echo "Source: ESLint v8+ and v9+ documentation on configuration files"
echo ""

echo "=== Current state analysis ==="
echo "Files present:"
echo "1. .eslintrc.js (legacy) ✓"
echo "2. tests/.eslintrc.js (legacy) ✓"
echo "3. eslint.config.js (flat) ✓"
echo ""
echo "Result: Legacy .eslintrc.js WILL BE USED"
echo "        eslint.config.js WILL BE IGNORED"
echo ""

echo "=== Verify by checking file content differences ==="
echo "Legacy .eslintrc.js extends: eslint:recommended"
grep -i 'extends' .eslintrc.js

echo ""
echo "Flat eslint.config.js uses: js.configs.recommended"
grep -i 'configs.recommended' eslint.config.js || echo "Different approach in flat config"

Repository: codingworkflow/ai-code-fusion

Length of output: 1037


Delete legacy .eslintrc.js and tests/.eslintrc.js to complete the flat config migration.

The new eslint.config.js is currently being ignored because ESLint prioritizes legacy .eslintrc.* files over flat config files when both exist. This means all the rule configurations in the new flat config—including the stricter rules, import ordering, and Jest relaxations—are not actually being applied. To activate the flat config, remove the legacy configuration files.

🤖 Prompt for AI Agents
In `@eslint.config.js` around lines 1 - 9, Legacy .eslintrc.js files are taking
precedence over the new flat config in eslint.config.js so your new rules (see
symbols like js, tsParser, importPlugin, jestPlugin, reactPlugin) aren’t
applied; delete the legacy .eslintrc.js files (root and tests/.eslintrc.js) from
the repo, commit that removal, and re-run the linter/CI to ensure
eslint.config.js is now picked up and the new flat config rules are enforced.

Comment thread package.json
@Mehdi-Bl

Copy link
Copy Markdown
Contributor Author

Addressed Sourcery's review feedback in commit b8814d7:

  • upgraded eslint to ^9.39.2 so flat config and @eslint/js are on matching major versions
  • updated App.tsx first-load effect to keep an explicit mount-only dependency array and added a justified react-hooks/exhaustive-deps suppression comment for the stable preload bridge reference
  • retired legacy .eslintignore (renamed to .eslintignore.legacy) to remove ESLint 9 migration warnings

Re-ran validation:

  • npm run lint
  • npm test -- --runInBand
  • npm run sonar (still blocked locally by Vault/Sonar auth: HTTP 401)

@sonarqubecloud

Copy link
Copy Markdown

@Mehdi-Bl Mehdi-Bl merged commit 3899531 into main Feb 12, 2026
23 checks passed
@Mehdi-Bl Mehdi-Bl deleted the ci-17-eslint-phase1 branch February 12, 2026 06:18
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.

1 participant