Skip to content

chore(deps-dev): bump eslint from 8.57.1 to 10.5.0#1046

Merged
ashleyshaw merged 3 commits into
developfrom
chore/eslint-10-migration
Jul 15, 2026
Merged

chore(deps-dev): bump eslint from 8.57.1 to 10.5.0#1046
ashleyshaw merged 3 commits into
developfrom
chore/eslint-10-migration

Conversation

@ashleyshaw

@ashleyshaw ashleyshaw commented Jul 15, 2026

Copy link
Copy Markdown
Member

Chore Pull Request

Linked issues

Relates to #1005 (superseded — closed; this is a clean re-creation from current develop).

Summary

Bumps eslint from 8.57.1 to 10.5.0 (two major versions). This required supporting changes beyond the version bump alone — see below.

Changes

  • Adds @eslint/js as an explicit devDependency. ESLint 8 bundled it as a transitive dependency; ESLint 10 doesn't, so eslint.config.cjs's require("@eslint/js") broke without it.
  • Raises engines.node from >=18.0.0 to >=20.19.0eslint@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 only affects 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.
    • Added { cause: error } to throw new Error(...) calls 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.

Impact / Compatibility

  • Runtime/behaviour changes: None to application logic. Thrown errors now carry their original cause for better debugging; a few dead-code assignments removed.
  • Build/dev-experience impact: Contributors on Node <20.19 will need to upgrade to run npm ci/lint locally (CI is unaffected).

Verification

  • CI passes
  • Local build and smoke tests
  • Docs updated if developer-facing

Risk & Rollback

  • Risk level: Medium (major version + Node engine floor change), mitigated by full lint + test verification.
  • Rollback plan: revert commit.

Changelog

Changed

  • Bumped eslint 8.57.1 → 10.5.0; raised engines.node floor to >=20.19.0; added @eslint/js; migrated .eslintignore into flat config; fixed 25 new-rule violations (no-useless-assignment, preserve-caught-error).

Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated (unit/E2E as appropriate)
  • Accessibility checklist completed (where relevant): N/A — no UI/markup changes in this PR
    • Semantic HTML and heading order verified (N/A)
    • Keyboard navigation and visible focus states verified (N/A)
    • ARIA used only where needed (N/A)
    • Contrast and non-colour cues reviewed (N/A)
  • Docs/readme/changelog updated (if user-facing)
  • Security checklist completed (where relevant): reviewed, no user-facing input/output paths touched
    • Untrusted input validated and sanitised (N/A)
    • Output escaped for its rendering context (N/A)
    • Privileged actions enforce nonce and capability checks (N/A)
    • No secrets/sensitive data introduced; OWASP risks reviewed
  • Code/design reviews approved
  • CI green; linked issues closed; release notes prepared (if shipping)

🤖 Generated with Claude Code

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).
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

✅ Template check passed after update. Thanks for fixing the PR description.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@ashleyshaw, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: fe5b0d21-0e44-49e9-8c76-299589435c8c

📥 Commits

Reviewing files that changed from the base of the PR and between 053a5da and f8a3aee.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (22)
  • .eslintignore
  • .github/metrics/frontmatter-metrics.js
  • CHANGELOG.md
  • eslint.config.cjs
  • package.json
  • scripts/agents/branding-unified.agent.js
  • scripts/agents/includes/label-sync.js
  • scripts/agents/linting.agent.js
  • scripts/agents/planner.agent.js
  • scripts/agents/release.agent.js
  • scripts/agents/reviewer.agent.js
  • scripts/agents/template.agent.js
  • scripts/skill-utils/packageSkillZip.js
  • scripts/validation/__tests__/validate-agent-frontmatter.test.js
  • scripts/validation/__tests__/validate-frontmatter.test.js
  • scripts/validation/__tests__/validate-json.test.js
  • scripts/validation/sync-frontmatter-dates.js
  • scripts/validation/validate-frontmatter-freshness.js
  • scripts/validation/validate-frontmatter.js
  • skills/design-md-agent/pdfs/js/installDeps.js
  • skills/design-md-agent/slides/pptxgenjs_helpers/latex.js
  • tests/test-template-labels.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/eslint-10-migration

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.

@github-actions github-actions Bot added status:needs-review Awaiting code review type:chore Chore / small hygiene change priority:normal Default priority area:labels Label governance and routing area:dependencies Composer/npm dependency work area:tests Test suites & harnesses area:scripts Scripts & tooling lang:js JavaScript/TypeScript lang:json JSON config/content meta:needs-changelog Requires a changelog entry before merge labels Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #1046

CI Status:success
Files changed: 23
Risk Distribution: 0 critical, 2 high, 3 medium, 18 low

Recommendations

  • Ready to proceed pending human review

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

Copy link
Copy Markdown
Contributor

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 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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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.

Suggested change
let output;
let output = "";

if (!match) return { raw: null, data: null, body: content };
const raw = match[0];
let data = null;
let data;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
let gitLog;
let gitLog = "";

@github-actions

Copy link
Copy Markdown
Contributor

Metadata governance

@github-actions github-actions Bot added area:documentation Docs & guides lang:md Markdown content/docs labels Jul 15, 2026
@ashleyshaw
ashleyshaw merged commit 5bf7976 into develop Jul 15, 2026
27 checks passed
@ashleyshaw
ashleyshaw deleted the chore/eslint-10-migration branch July 15, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dependencies Composer/npm dependency work area:documentation Docs & guides area:labels Label governance and routing area:scripts Scripts & tooling area:tests Test suites & harnesses lang:js JavaScript/TypeScript lang:json JSON config/content lang:md Markdown content/docs meta:needs-changelog Requires a changelog entry before merge priority:normal Default priority status:needs-review Awaiting code review type:chore Chore / small hygiene change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant