Skip to content

Migrate ESLint to flat config for Next 16#8

Merged
f1shyfang merged 1 commit into
mainfrom
fix/eslint-flat-config-next16
May 30, 2026
Merged

Migrate ESLint to flat config for Next 16#8
f1shyfang merged 1 commit into
mainfrom
fix/eslint-flat-config-next16

Conversation

@f1shyfang
Copy link
Copy Markdown
Owner

Problem

npm run lint was broken on two fronts after the Next 16 upgrade:

  1. next lint was removed in Next 16 — it parsed lint as a directory path and errored.
  2. The legacy .eslintrc.json (extends: next/core-web-vitals) is incompatible with ESLint 9's flat config; FlatCompat threw Converting circular structure to JSON on eslint-config-next@16.

Fix

  • lint script → eslint ..
  • Replace .eslintrc.json with eslint.config.mjs (ESLint 9 flat config). eslint-config-next@16 ships native flat-config arrays, so we import eslint-config-next/core-web-vitals and spread it directly (no FlatCompat). Adds ignores for build output, the Python backend, ml_training, venv, and archived code.
  • Fix 7 react/no-unescaped-entities errors so lint exits clean.

Verification

  • npm run lintexit 0 (0 errors; 12 pre-existing warnings remain: <img> usage + react-hooks/exhaustive-deps).
  • npx tsc --noEmit → 0 errors.

🤖 Generated with Claude Code

- next lint was removed in Next 16; switch the lint script to 'eslint .'.
- Replace legacy .eslintrc.json with eslint.config.mjs (ESLint 9 flat config),
  importing eslint-config-next@16's native flat-config array directly (no
  FlatCompat, which choked on circular plugin refs). Adds ignores for build
  output, the Python backend, ml_training, venv, and archived code.
- Fix 7 react/no-unescaped-entities errors so 'npm run lint' exits clean
  (12 pre-existing warnings remain: <img> usage and exhaustive-deps).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 30, 2026 08:57
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

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

Project Deployment Actions Updated (UTC)
lyra-hackathon Ready Ready Preview, Comment May 30, 2026 8:58am

@f1shyfang f1shyfang merged commit 2d92e53 into main May 30, 2026
1 of 3 checks passed
@f1shyfang f1shyfang deleted the fix/eslint-flat-config-next16 branch May 30, 2026 08:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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