diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000000..719cea2b59f --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,25 @@ +import { dirname } from "path"; +import { fileURLToPath } from "url"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const compat = new FlatCompat({ + baseDirectory: __dirname, +}); + +const eslintConfig = [ + ...compat.extends("next/core-web-vitals", "next/typescript"), + { + ignores: [ + "node_modules/**", + ".next/**", + "out/**", + "build/**", + "next-env.d.ts", + ], + }, +]; + +export default eslintConfig; diff --git a/package.json b/package.json index c36be6853bd..59213e42711 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ "build:remote": "tsx ./utils/remote-content.mts", "start": "pnpm build:remote && next build && next start", "check-links": "tsx .github/linkChecker.ts", - "postinstall": "prisma generate && fumadocs-mdx && node ./scripts/update_docker_tags.mjs" + "postinstall": "prisma generate && fumadocs-mdx && node ./scripts/update_docker_tags.mjs", + "lint": "eslint", + "lint:fix": "eslint --fix" }, "dependencies": { "@ai-sdk/anthropic": "^1.2.12", @@ -134,6 +136,7 @@ "zustand": "^5.0.3" }, "devDependencies": { + "@eslint/eslintrc": "^3", "@tailwindcss/postcss": "^4.0.9", "@tailwindcss/typography": "^0.5.16", "@types/mdx": "^2.0.13", @@ -142,6 +145,8 @@ "@types/react": "^19.0.10", "@types/react-dom": "^19.0.4", "dotenv": "^16.4.7", + "eslint": "^9", + "eslint-config-next": "15.4.7", "postcss": "^8.5.3", "prisma": "^6.4.1", "tailwindcss": "^4.0.9",