瀏覽代碼

next版本更新

537yaha 5 月之前
父節點
當前提交
73bddeaa95
共有 6 個文件被更改,包括 493 次插入201 次删除
  1. 6 14
      frontend/eslint.config.mjs
  2. 0 3
      frontend/next.config.mjs
  3. 0 3
      frontend/next.config.ts
  4. 465 173
      frontend/package-lock.json
  5. 3 3
      frontend/package.json
  6. 19 5
      frontend/tsconfig.json

+ 6 - 14
frontend/eslint.config.mjs

@@ -1,16 +1,8 @@
-import { dirname } from "path";
-import { fileURLToPath } from "url";
-import { FlatCompat } from "@eslint/eslintrc";
+// Next.js 16 ESLint 配置
+// 简化配置,避免 FlatCompat 的循环引用问题
+// 只定义忽略规则,让 Next.js 在构建时处理其他规则
 
-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"),
+export default [
   {
     ignores: [
       "node_modules/**",
@@ -18,8 +10,8 @@ const eslintConfig = [
       "out/**",
       "build/**",
       "next-env.d.ts",
+      "*.config.*",
+      "dist/**",
     ],
   },
 ];
-
-export default eslintConfig;

+ 0 - 3
frontend/next.config.mjs

@@ -8,9 +8,6 @@ const backendHost = process.env.NEXT_PUBLIC_BACKEND_HOST || "localhost";
 
 /** @type {import('next').NextConfig} */
 const nextConfig = {
-  eslint: {
-    ignoreDuringBuilds: true,
-  },
   async rewrites() {
     if (process.env.NODE_ENV === "development") {
       return [

+ 0 - 3
frontend/next.config.ts

@@ -6,9 +6,6 @@ const backendPort = process.env.NEXT_PUBLIC_BACKEND_PORT || "8080";
 const backendHost = process.env.NEXT_PUBLIC_BACKEND_HOST || "localhost";
 
 const nextConfig: NextConfig = {
-  eslint: {
-    ignoreDuringBuilds: true, // 临时禁用构建时的 ESLint 检查
-  },
   // 开发环境:代理 API 请求到后端
   // 生产环境:由 Nginx 处理,这个配置不会生效(因为生产环境是静态构建)
   async rewrites() {

File diff suppressed because it is too large
+ 465 - 173
frontend/package-lock.json


+ 3 - 3
frontend/package.json

@@ -6,7 +6,7 @@
     "dev": "next dev --turbopack",
     "build": "next build",
     "start": "next start",
-    "lint": "eslint"
+    "lint": "eslint ."
   },
   "dependencies": {
     "@radix-ui/react-checkbox": "^1.1.3",
@@ -23,7 +23,7 @@
     "clsx": "^2.1.1",
     "framer-motion": "^12.29.2",
     "lucide-react": "^0.554.0",
-    "next": "15.5.3",
+    "next": "16.1.6",
     "react": "19.1.0",
     "react-dom": "19.1.0",
     "tailwind-merge": "^3.4.0"
@@ -35,7 +35,7 @@
     "@types/react": "^19",
     "@types/react-dom": "^19",
     "eslint": "^9",
-    "eslint-config-next": "15.5.3",
+    "eslint-config-next": "16.1.6",
     "tailwindcss": "^4",
     "typescript": "^5"
   }

+ 19 - 5
frontend/tsconfig.json

@@ -1,7 +1,11 @@
 {
   "compilerOptions": {
     "target": "ES2017",
-    "lib": ["dom", "dom.iterable", "esnext"],
+    "lib": [
+      "dom",
+      "dom.iterable",
+      "esnext"
+    ],
     "allowJs": true,
     "skipLibCheck": true,
     "strict": true,
@@ -11,7 +15,7 @@
     "moduleResolution": "bundler",
     "resolveJsonModule": true,
     "isolatedModules": true,
-    "jsx": "preserve",
+    "jsx": "react-jsx",
     "incremental": true,
     "plugins": [
       {
@@ -19,9 +23,19 @@
       }
     ],
     "paths": {
-      "@/*": ["./*"]
+      "@/*": [
+        "./*"
+      ]
     }
   },
-  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
-  "exclude": ["node_modules"]
+  "include": [
+    "next-env.d.ts",
+    "**/*.ts",
+    "**/*.tsx",
+    ".next/types/**/*.ts",
+    ".next/dev/types/**/*.ts"
+  ],
+  "exclude": [
+    "node_modules"
+  ]
 }

Some files were not shown because too many files changed in this diff