next版本更新

This commit is contained in:
537yaha
2026-02-27 22:36:54 +08:00
parent 48cfccf422
commit 73bddeaa95
6 changed files with 837 additions and 377 deletions
+6 -14
View File
@@ -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;
-3
View File
@@ -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 [
-3
View File
@@ -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() {
+809 -349
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -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
View File
@@ -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"
]
}