-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
问题描述
项目工程化配置一团糟:
next.config.mjs里 TypeScript 和 lint 错误被全局禁用package.json的 lint 脚本报错(找不到 lint 目录)- TypeScript 类型检查被关闭,导致满屏的类型错误没人管
- React StrictMode 被关闭
// next.config.mjs
typescript: {
ignoreBuildErrors: true, // 类型检查躺平
},影响范围
- 所有类型错误都被吞掉了
- 新人不知道代码有多少问题
- 代码质量完全失控
建议方案
1. 修复 next.config.mjs
// next.config.mjs
const nextConfig = {
reactStrictMode: true, // 打开严格模式
// 删除 ignoreBuildErrors: true
};2. 修复 package.json lint 脚本
{
"scripts": {
"lint": "next lint --dir src",
"typecheck": "tsc --noEmit"
}
}3. 逐个修复 TypeScript 错误(可以新建一个表格追踪)
相关 Issue(建议关闭)
- TypeScript 类型检查被全局禁用 (TypeScript 类型检查被全局禁用 #18)
- 类型错误:interview-kanban.tsx 组件类型问题一堆 (类型错误:interview-kanban.tsx 组件类型问题一堆 #27)
- 类型错误:GlobalSearch.tsx 菜单类型定义缺失 (类型错误:GlobalSearch.tsx 菜单类型定义缺失 #28)
- 依赖缺失:swagger-ui-react 没有类型定义 (依赖缺失:swagger-ui-react 没有类型定义 #29)
- 类型错误:resume-bank.tsx 状态类型不匹配 (类型错误:resume-bank.tsx 状态类型不匹配 #30)
- 类型错误:layout 组件 pathname/searchParams 可能为 null (类型错误:layout 组件 pathname/searchParams 可能为 null #32)
- 类型错误:email-system.tsx searchParams 可能为 null (类型错误:email-system.tsx searchParams 可能为 null #37)
- 可读性:postinstall 脚本没有注释说明 (可读性:postinstall 脚本没有注释说明 #33)
本 Issue 由 Memo Code 生成。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels