From a02ea4de8fe64dd76bb677031103c0cf02704be0 Mon Sep 17 00:00:00 2001 From: Michael Feng Date: Sat, 30 May 2026 18:57:25 +1000 Subject: [PATCH] fix: migrate ESLint to flat config for Next 16 - 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: usage and exhaustive-deps). Co-Authored-By: Claude Opus 4.8 (1M context) --- .eslintrc.json | 4 --- app/components/premium/AnalysisPreview.tsx | 6 ++--- app/examples/ai-personas/page.tsx | 2 +- app/examples/gemini/page.tsx | 2 +- eslint.config.mjs | 30 ++++++++++++++++++++++ package.json | 2 +- 6 files changed, 36 insertions(+), 10 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index f18272b..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "next/core-web-vitals" -} - diff --git a/app/components/premium/AnalysisPreview.tsx b/app/components/premium/AnalysisPreview.tsx index b8a8aac..e12035a 100644 --- a/app/components/premium/AnalysisPreview.tsx +++ b/app/components/premium/AnalysisPreview.tsx @@ -20,13 +20,13 @@ export function AnalysisPreview() {

Excited to announce our team is growing!

- We're tackling complex challenges in distributed systems + We're tackling complex challenges in distributed systems

Looking for engineers who love diving deep into open-source projects and optimising for performance.

- If you're passionate about building resilient systems + If you're passionate about building resilient systems

-

and contributing to the community, let's chat.

+

and contributing to the community, let's chat.

diff --git a/app/examples/ai-personas/page.tsx b/app/examples/ai-personas/page.tsx index 7ba33f5..a16bdd1 100644 --- a/app/examples/ai-personas/page.tsx +++ b/app/examples/ai-personas/page.tsx @@ -784,7 +784,7 @@ export default function AIPersonasPage() {
{getAllTags().length === 0 ? ( -
No tags yet. Add tags in "Edit persona".
+
No tags yet. Add tags in "Edit persona".
) : ( getAllTags().map(tag => (
  • Select a model from the dropdown
  • Enter your prompt in the text area
  • -
  • Click "Generate Response" to send the request
  • +
  • Click "Generate Response" to send the request
  • The response will appear below
  • diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..da21304 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,30 @@ +import next from 'eslint-config-next/core-web-vitals' + +// ESLint 9 flat config for Next.js 16. +// `next lint` was removed in Next 16, so linting runs via the ESLint CLI +// (`eslint .` — see the "lint" script). eslint-config-next@16 ships native +// flat-config arrays, so we import and spread them directly (no FlatCompat). +// Replaces the legacy .eslintrc.json (`extends: next/core-web-vitals`). +const eslintConfig = [ + // Flat config replaces .eslintignore — list non-source paths here. + { + ignores: [ + '.next/**', + 'out/**', + 'build/**', + 'node_modules/**', + 'next-env.d.ts', + // Python backend / ML training + virtualenv + archived code + 'venv/**', + '.venv/**', + 'ml_training/**', + 'archive/**', + 'output/**', + 'data/**', + '**/*.py', + ], + }, + ...next, +] + +export default eslintConfig diff --git a/package.json b/package.json index 68f2837..3e11f98 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dev:ml": "uvicorn api:app --reload --host 0.0.0.0 --port 8000", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "eslint .", "types:generate": "supabase gen types typescript --project-id YOUR_PROJECT_ID > types/supabase.ts || echo 'Install Supabase CLI and set your project ID to generate types'" }, "repository": {