96b944ac8d
- 更新 ESLint 配置添加 react-hooks 规则 - 运行 Prettier 格式化所有前端文件 - 为 users、apps、audit、quotas 页面添加 Skeleton 加载骨架屏 - 修复动态组件渲染问题(CategoryIcon/TypeIcon 使用 React.createElement) - 修复 useRef 渲染期间访问问题(改用 useMemo) - 修复 effect 中 setState 同步调用问题 - 新增 global-not-found.tsx 404 页面 - 修复 knowledge 页面引号转义问题
26 lines
654 B
JavaScript
26 lines
654 B
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
|
import prettier from "eslint-plugin-prettier";
|
|
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
import nextTs from "eslint-config-next/typescript";
|
|
|
|
const eslintConfig = defineConfig([
|
|
...nextVitals,
|
|
...nextTs,
|
|
{
|
|
plugins: { prettier },
|
|
rules: {
|
|
"prettier/prettier": "error",
|
|
},
|
|
},
|
|
// QueryClient 单例模式必须使用 ref 检查,非 bug
|
|
{
|
|
files: ["src/components/providers.tsx"],
|
|
rules: {
|
|
"react-hooks/refs": "off",
|
|
},
|
|
},
|
|
globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
|
|
]);
|
|
|
|
export default eslintConfig;
|