chore(deps-dev): bump eslint from 8.57.1 to 10.5.0#1046
Conversation
Bumps eslint to the current major (10.5.0). This requires several
supporting changes since it's a two-major-version jump:
- Adds @eslint/js as an explicit devDependency. ESLint 8 bundled it as
a transitive dependency; 10.x does not, so eslint.config.cjs's
`require("@eslint/js")` broke without it.
- Raises the repo's engines.node floor from >=18.0.0 to >=20.19.0 —
eslint@10 requires Node ^20.19.0 || ^22.13.0 || >=24, and this
repo's .npmrc has engine-strict=true. All CI workflows already run
Node 20 or 22.22.1, so this doesn't affect CI, only local dev on
very old Node versions.
- Fixes 25 new error-level violations from rules ESLint 9/10 added to
recommended (`no-useless-assignment`, `preserve-caught-error`):
- Removed dead initial values on `let` bindings that are always
reassigned before any read (e.g. `let output = ""` immediately
followed by an if/else that always sets `output`).
- Added `{ cause: error }` to `throw new Error(...)` inside catch
blocks that were discarding the original error.
- Migrates `.eslintignore` (silently unread by ESLint 10 — flat
config only recognizes the `ignores` array) into eslint.config.cjs's
existing ignoreFolders list, and deletes the now-dead file.
- `--fix` also removed a handful of `/* eslint-disable no-console */`
comments that were already no-ops (no-console is "off" in this
config) — ESLint 10 flags and removes unused disable directives by
default.
Verified: npm ci, npm run lint:all (0 errors), npm run test:js
(668/668 passing).
|
✅ Template check passed after update. Thanks for fixing the PR description. |
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (22)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
🔍 Reviewer Summary for PR #1046CI Status: ✅ Recommendations
|
There was a problem hiding this comment.
Code Review
This pull request upgrades ESLint to version 10, updates the minimum Node.js engine requirement to >=20.19.0, migrates ignored paths to the ESLint configuration file, and improves error handling across various scripts by appending the original error as the cause. Additionally, several variable declarations were refactored to satisfy linter rules. However, the review feedback highlights that some of these refactorings (specifically in validate-frontmatter-freshness.js and release.agent.js) introduce potential runtime TypeError bugs by leaving variables like output, data, and gitLog as undefined instead of falling back to safe defaults.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| function changedMarkdownFiles({ base, head, staged }) { | ||
| let output = ""; | ||
| let output; |
There was a problem hiding this comment.
If neither staged nor base && head is true, output will remain undefined instead of falling back to "". If subsequent code attempts to call string methods on output (such as .split('\n')), this will result in a runtime TypeError. To satisfy the linter without risking a runtime crash, consider using a fallback value or ensuring output is always a string.
| let output; | |
| let output = ""; |
| if (!match) return { raw: null, data: null, body: content }; | ||
| const raw = match[0]; | ||
| let data = null; | ||
| let data; |
There was a problem hiding this comment.
By removing the initial null assignment, data will now be undefined if yaml.load throws an error. If subsequent code performs strict equality checks (e.g., data === null), this change could introduce bugs. To safely satisfy the linter while preserving the null fallback, you can assign data = null; inside the catch block.
| } | ||
|
|
||
| let gitLog = ""; | ||
| let gitLog; |
There was a problem hiding this comment.
If fromTag is falsy, gitLog will now be undefined instead of "". If subsequent code expects a string (e.g., calling .split('\n') or other string methods), this will throw a TypeError. If you want to avoid the ESLint warning while keeping the safe fallback, consider initializing gitLog to "" in an else block or using a ternary operator if possible.
| let gitLog; | |
| let gitLog = ""; |
Metadata governance
|
Chore Pull Request
Linked issues
Relates to #1005 (superseded — closed; this is a clean re-creation from current
develop).Summary
Bumps
eslintfrom 8.57.1 to 10.5.0 (two major versions). This required supporting changes beyond the version bump alone — see below.Changes
@eslint/jsas an explicit devDependency. ESLint 8 bundled it as a transitive dependency; ESLint 10 doesn't, soeslint.config.cjs'srequire("@eslint/js")broke without it.engines.nodefrom>=18.0.0to>=20.19.0—eslint@10requires Node^20.19.0 || ^22.13.0 || >=24, and this repo's.npmrchasengine-strict=true. All CI workflows already run Node 20 or 22.22.1, so this only affects local dev on very old Node versions.recommended(no-useless-assignment,preserve-caught-error):letbindings that are always reassigned before any read.{ cause: error }tothrow new Error(...)calls inside catch blocks that were discarding the original error..eslintignore(silently unread by ESLint 10 — flat config only recognizes theignoresarray) intoeslint.config.cjs's existingignoreFolderslist, and deletes the now-dead file.--fixalso removed a handful of/* eslint-disable no-console */comments that were already no-ops (no-consoleis"off"in this config) — ESLint 10 flags and removes unused disable directives by default.Impact / Compatibility
npm ci/lint locally (CI is unaffected).Verification
Risk & Rollback
Changelog
Changed
eslint8.57.1 → 10.5.0; raisedengines.nodefloor to>=20.19.0; added@eslint/js; migrated.eslintignoreinto flat config; fixed 25 new-rule violations (no-useless-assignment,preserve-caught-error).Checklist (Global DoD / PR)
🤖 Generated with Claude Code