Skip to content

build(deps): migrate to eslint 9 flat config - #17

Merged
hash00 merged 1 commit into
mainfrom
fix/eslint9-flat-config
Sep 3, 2026
Merged

hash00 merged 1 commit into
mainfrom
fix/eslint9-flat-config

Conversation

@hash00

@hash00 hash00 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Unblocks eslint-plugin-react-refresh >=0.5, whose peer range requires
eslint ^9||^10 and couldn't be satisfied under the legacy .eslintrc.cjs
(ESLint 8) setup — this is exactly what broke #14's npm ci.

  • eslint 8.57 → 10.9, swap @typescript-eslint/eslint-plugin +
    @typescript-eslint/parser for the typescript-eslint meta package
    (8.69, flat-config native), eslint-plugin-react-refresh → 0.5.6.
  • Replace .eslintrc.cjs with eslint.config.mjs — same rules and
    per-file overrides (electron/ node globals, theme-file Fast Refresh
    exemptions), scoped to **/*.{ts,tsx} to match the old --ext ts,tsx.
  • Fix two @typescript-eslint/no-unused-expressions hits in LogTable.tsx
    (ternary used for its side effect — the new recommended ruleset catches
    this, the old one didn't); rewritten as if/else, same behavior.
  • Extend the theme.tsx Fast Refresh exemption to ThemeToggle.tsx
    (colocated constants, not worth splitting the file for).

npm run lint && npm run typecheck && npm test && npm run build all pass.

Unblocks eslint-plugin-react-refresh >=0.5, whose peer range requires
eslint ^9||^10 and could not be satisfied under the legacy .eslintrc.cjs
setup (PR #14's build failed on this exact ERESOLVE conflict).

- eslint 8.57 -> 10.9, @typescript-eslint/{eslint-plugin,parser} ->
  the typescript-eslint meta package (8.69, flat-config native),
  eslint-plugin-react-refresh -> 0.5.6.
- Replace .eslintrc.cjs with eslint.config.mjs; same rule set and
  per-file overrides (electron/ node globals, theme file exemptions),
  scoped to ts/tsx to match the old --ext ts,tsx behavior.
- Fix two @typescript-eslint/no-unused-vars/no-unused-expressions hits
  in LogTable.tsx (ternary used for its side effect, now if/else) that
  the new recommended ruleset catches and the old one didn't.
- Extend the ThemeToggle.tsx Fast Refresh exemption already used for
  theme.tsx (colocated constants, not worth splitting for).
Copilot AI lite review requested due to automatic review settings September 3, 2026 17:27
@hash00
hash00 merged commit 9b22274 into main Sep 3, 2026
4 checks passed
@hash00
hash00 deleted the fix/eslint9-flat-config branch September 3, 2026 17:29

Copilot AI 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.

🟡 Changes recommended

The ESLint upgrade introduces a stricter Node engine requirement than the repo’s declared engines.node, which can cause local lint/tooling failures on “supported” Node versions.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Migrates the repo’s linting setup from ESLint 8 + legacy .eslintrc.cjs to ESLint 10 + flat config (eslint.config.mjs) to unblock newer eslint-plugin-react-refresh peer requirements and restore npm ci compatibility.

Changes:

  • Upgraded linting dependencies (ESLint, TypeScript ESLint via typescript-eslint, eslint-plugin-react-refresh) and adjusted the lint script for flat config.
  • Replaced .eslintrc.cjs with eslint.config.mjs, preserving prior rule intent and key file-specific overrides.
  • Refactored two side-effect ternaries in LogTable.tsx into explicit if/else to satisfy stricter lint rules.
File summaries
File Description
src/components/LogTable.tsx Rewrites side-effect ternaries to if/else to comply with updated lint rules.
package.json Updates lint command and devDependencies to ESLint 10 + flat-config ecosystem.
package-lock.json Locks the upgraded ESLint/tooling dependency graph.
eslint.config.mjs Introduces ESLint flat config with TypeScript + React Hooks/Refresh rules and overrides.
.eslintrc.cjs Removes legacy ESLint config.
Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json
"dev": "vite",
"build": "tsc && vite build && electron-builder",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
hash00 added a commit that referenced this pull request Sep 3, 2026
…#18)

@tanstack/react-virtual 3.14.9->3.14.10, @testing-library/react
16.3.2->16.3.3, vite-plugin-electron 1.1.1->1.1.2, vitest 4.1.10->4.1.11.

postcss and eslint-plugin-react-refresh were already at/above this
PR's targets after #15 and #17; autoprefixer's bump is moot (removed
in #6).
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.

2 participants