Skip to content

Migrate to ESLint 10 and ESLint React - #1239

Merged
danbarr merged 3 commits into
mainfrom
migrate-eslint-react
Oct 16, 2026
Merged

danbarr merged 3 commits into
mainfrom
migrate-eslint-react

Conversation

@danbarr

@danbarr danbarr commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

ESLint 9 is end of life, and the released eslint-plugin-react still depends on APIs removed in ESLint 10. Upgrade ESLint to 10.12.0 and replace that plugin with @eslint-react/eslint-plugin, following its migration guide and TypeScript preset.

Keep eslint-plugin-mdx and preserve Docusaurus component globals. Use ESLint 10's native JSX reference tracking to catch undefined MDX components, and disable the Hooks placement rule for MDX because page expressions compile into a component render body. Explicitly retain available equivalents of the previous recommended checks.

Move ProductCard's URL Hook to the component body and use its URL helper in conditional rendering. Preserve caught errors as cause to satisfy ESLint 10's recommended rules. Add npm run typecheck to PR static checks, including duplicate JSX prop checking in TSX.

Coverage differs from the previous plugin: duplicate JSX props in MDX and some legacy React checks have no built-in equivalent. Use stable keys for CRD enum values and modifier separators. Clean up HubSpot script load listeners on unmount and include the target element ID in the effect dependencies.

Type of change

  • Bug fix (development tooling and CI)

Related issues/PRs

Validation

  • npm run build passes.
  • npm run typecheck passes.
  • npm run eslint passes with no warnings.
  • npm run prettier passes.
  • Lint probes confirm undefined MDX components are rejected, imported and global components are accepted, and missing list keys are caught in both TSX and MDX.
  • git diff --check passes.

Submitter checklist

Content and formatting

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Reviewer checklist

Content

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Copilot AI balanced review requested due to automatic review settings October 14, 2026 20:04
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-website Ready Ready Preview Oct 14, 2026 8:12pm UTC

Request Review

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

🟡 Changes recommended

The partial-specific override disables the new undefined-component detection for all MDX partials.

1 open finding
What changed in this PR

Migrates static analysis to ESLint 10 and ESLint React while updating affected code and CI checks.

Changes:

  • Replaces eslint-plugin-react and updates ESLint configuration.
  • Fixes hook placement and preserves caught error causes.
  • Adds TypeScript checking to PR validation.
File Description
package.json Updates linting dependencies.
eslint.config.mjs Migrates React and MDX lint rules.
src/​components/​ProductCard/​index.tsx Moves base URL hook usage to the component body.
plugins/​mcp-metadata-plugin/​src/​utils.ts Preserves the original error as the cause.
.github/​workflows/​_static-checks.yaml Adds TypeScript checking to CI.

🧠 Review effort: Balanced


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

Comment thread eslint.config.mjs

@aponcedeleonch aponcedeleonch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Quick disclaimer: I'm no expert with React, so I drove this review completely with the help of AI and focused on checking for regressions.

What I checked:

  • ESLint, typecheck, and Prettier pass on the PR head and with current main merged in (the eslint.config.mjs merge is clean).
  • Built both main and the merged PR and diffed the rendered HTML after normalizing asset hashes. All 383 pages are identical.
  • Probed the MDX lint config with throwaway files. Undefined components are caught in pages and partials, globals and imports resolve, missing keys are caught, and props is only allowed in partials.

One small follow-up: renovate.json still has the "Temporarily block eslint v10" rule for eslint and @eslint/js. It's stale after this lands, so it might be worth removing here or in a follow-up so future ESLint majors aren't skipped.

@danbarr
danbarr merged commit a998068 into main Oct 16, 2026
6 checks passed
@danbarr
danbarr deleted the migrate-eslint-react branch October 16, 2026 13:59
@danbarr danbarr mentioned this pull request Oct 16, 2026
2 of 4 tasks

This branch was successfully deployed

1 active deployment
Preview — 66578927 Deployed Oct 14, 2026 by vercel[bot]
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.

3 participants