diff --git a/eslint.config.mjs b/eslint.config.mjs index 42ff59d..4e5211c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -5,6 +5,7 @@ import pluginReact from 'eslint-plugin-react'; import { defineConfig } from 'eslint/config'; import reactHooks from 'eslint-plugin-react-hooks'; import reactRefresh from 'eslint-plugin-react-refresh'; +import nextPlugin from '@next/eslint-plugin-next'; export default defineConfig([ { @@ -24,17 +25,18 @@ export default defineConfig([ }, tseslint.configs.recommended, pluginReact.configs.flat.recommended, + nextPlugin.configs.recommended, { rules: { - '@typescript-eslint/no-explicit-any': 'off', - 'no-unused-vars': 'off', // 关闭未使用变量的检查 + '@typescript-eslint/no-explicit-any': 'warn', // 改为警告,鼓励使用具体类型 + 'no-unused-vars': 'warn', // 改为警告,提醒未使用的变量 'react-refresh/only-export-components': 'off', 'react/display-name': 'off', 'react/prop-types': 'off', // TypeScript 项目不需要 prop-types 验证 // 约束js使用单引号,允许jsx双引号 quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }], 'jsx-quotes': ['error', 'prefer-double'], - 'react-hooks/exhaustive-deps': 'off', + 'react-hooks/exhaustive-deps': 'warn', // 改为警告,提醒依赖数组 'react/react-in-jsx-scope': 'off', }, }, diff --git a/package-lock.json b/package-lock.json index 78582e2..de0e614 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,6 +59,7 @@ }, "devDependencies": { "@eslint/js": "^9.31.0", + "@next/eslint-plugin-next": "^16.1.6", "@types/aos": "^3.0.7", "@types/canvas-confetti": "^1.6.4", "@types/markdown-navbar": "^1.4.4", @@ -2899,6 +2900,46 @@ "integrity": "sha512-Te1wbiJ//I40T7UePOUG8QBwh+VVMCc0OTuqesOcD3849TVOVOyX4Hdrkx7wcpLpy/LOABIcGyLX5P/SzzXhFA==", "license": "MIT" }, + "node_modules/@next/eslint-plugin-next": { + "version": "16.1.6", + "resolved": "https://registry.npmmirror.com/@next/eslint-plugin-next/-/eslint-plugin-next-16.1.6.tgz", + "integrity": "sha512-/Qq3PTagA6+nYVfryAtQ7/9FEr/6YVyvOtl6rZnGsbReGLf0jZU6gkpr1FuChAQpvV46a78p4cmHOVP8mbfSMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "3.3.1" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/@next/swc-darwin-arm64": { "version": "15.1.9", "resolved": "https://registry.npmmirror.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.1.9.tgz", diff --git a/package.json b/package.json index 8cf6fab..82406de 100755 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ }, "devDependencies": { "@eslint/js": "^9.31.0", + "@next/eslint-plugin-next": "^16.1.6", "@types/aos": "^3.0.7", "@types/canvas-confetti": "^1.6.4", "@types/markdown-navbar": "^1.4.4", diff --git a/src/app/article/components/Comment/index.tsx b/src/app/article/components/Comment/index.tsx index 8b9ed1a..69398c8 100755 --- a/src/app/article/components/Comment/index.tsx +++ b/src/app/article/components/Comment/index.tsx @@ -173,7 +173,7 @@ const CommentForm = ({ articleId }: Props) => { className="tw_form w-full p-4 min-h-36" ref={(e) => { register('content').ref(e); - (contentRef as any).current = e; + contentRef.current = e; }} /> {errors.content?.message} diff --git a/src/app/my/component/Calendar/index.scss b/src/app/my/components/Calendar/index.scss similarity index 100% rename from src/app/my/component/Calendar/index.scss rename to src/app/my/components/Calendar/index.scss diff --git a/src/app/my/component/Calendar/index.tsx b/src/app/my/components/Calendar/index.tsx similarity index 100% rename from src/app/my/component/Calendar/index.tsx rename to src/app/my/components/Calendar/index.tsx diff --git a/src/app/my/component/Character/index.tsx b/src/app/my/components/Character/index.tsx similarity index 100% rename from src/app/my/component/Character/index.tsx rename to src/app/my/components/Character/index.tsx diff --git a/src/app/my/component/Goals/index.tsx b/src/app/my/components/Goals/index.tsx similarity index 100% rename from src/app/my/component/Goals/index.tsx rename to src/app/my/components/Goals/index.tsx diff --git a/src/app/my/component/IconCloud/index.tsx b/src/app/my/components/IconCloud/index.tsx similarity index 100% rename from src/app/my/component/IconCloud/index.tsx rename to src/app/my/components/IconCloud/index.tsx diff --git a/src/app/my/component/InfoOne/index.tsx b/src/app/my/components/InfoOne/index.tsx similarity index 100% rename from src/app/my/component/InfoOne/index.tsx rename to src/app/my/components/InfoOne/index.tsx diff --git a/src/app/my/component/InfoTwo/index.scss b/src/app/my/components/InfoTwo/index.scss similarity index 100% rename from src/app/my/component/InfoTwo/index.scss rename to src/app/my/components/InfoTwo/index.scss diff --git a/src/app/my/component/InfoTwo/index.tsx b/src/app/my/components/InfoTwo/index.tsx similarity index 100% rename from src/app/my/component/InfoTwo/index.tsx rename to src/app/my/components/InfoTwo/index.tsx diff --git a/src/app/my/component/Map/index.tsx b/src/app/my/components/Map/index.tsx similarity index 100% rename from src/app/my/component/Map/index.tsx rename to src/app/my/components/Map/index.tsx diff --git a/src/app/my/component/Project/index.tsx b/src/app/my/components/Project/index.tsx similarity index 100% rename from src/app/my/component/Project/index.tsx rename to src/app/my/components/Project/index.tsx diff --git a/src/app/my/component/Technology/index.tsx b/src/app/my/components/Technology/index.tsx similarity index 100% rename from src/app/my/component/Technology/index.tsx rename to src/app/my/components/Technology/index.tsx diff --git a/src/app/wall/components/AddWallInfo/index.tsx b/src/app/wall/components/AddWallInfo/index.tsx index d387c5f..7752a3d 100755 --- a/src/app/wall/components/AddWallInfo/index.tsx +++ b/src/app/wall/components/AddWallInfo/index.tsx @@ -3,7 +3,7 @@ import { useEffect, useState, useRef } from 'react'; import { Input, Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button, useDisclosure, Select, SelectItem, Textarea, RadioGroup, Radio } from '@heroui/react'; import { Controller, SubmitHandler, useForm } from 'react-hook-form'; -import { Wall } from '@/types/app/wall'; +import { Cate, Wall } from '@/types/app/wall'; import { addWallDataAPI, getCateListAPI } from '@/api/wall'; import { Bounce, toast, ToastContainer, ToastOptions } from 'react-toastify'; import HCaptchaType from '@hcaptcha/react-hcaptcha';