mirror of
https://github.com/margrop/wrong-notebook.git
synced 2026-12-01 23:39:26 +08:00
- 加载函数改为 useCallback 并移到使用它的 effect 之前,补全依赖 - 属性同步状态(重命名对话框、模型选择、知识点筛选)改为渲染时比较上一次的值;设置页多余的实例同步 effect 删除 - 提示词模板直接从配置推导,提醒框移出组件,避免每次渲染重新创建 - 标签建议在输入清空时由 onChange 收起,effect 只负责请求 - 挂载标记改用 useSyncExternalStore(新增 useIsClient),界面语言改为订阅 localStorage,其他标签页切换语言时同步 - GeoGebra 元素 ID 改用 useId - 数据请求类 effect 在调用处说明原因后忽略 set-state-in-effect - 图片均为 data URL 或 blob URL,关闭 no-img-element;logger 中的 module 变量改名 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
843 B
JavaScript
27 lines
843 B
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
||
import nextVitals from "eslint-config-next/core-web-vitals";
|
||
import nextTs from "eslint-config-next/typescript";
|
||
|
||
const eslintConfig = defineConfig([
|
||
...nextVitals,
|
||
...nextTs,
|
||
{
|
||
rules: {
|
||
// 允许用解构剔除字段后取剩余部分,如 const { password, ...rest } = user
|
||
"@typescript-eslint/no-unused-vars": ["warn", { ignoreRestSiblings: true }],
|
||
// 页面中的图片都是 base64 data URL 或本地 blob URL(题目原图、裁剪预览),next/image 无法优化
|
||
"@next/next/no-img-element": "off",
|
||
},
|
||
},
|
||
// Override default ignores of eslint-config-next.
|
||
globalIgnores([
|
||
// Default ignores of eslint-config-next:
|
||
".next/**",
|
||
"out/**",
|
||
"build/**",
|
||
"next-env.d.ts",
|
||
]),
|
||
]);
|
||
|
||
export default eslintConfig;
|