fix(frontend): clear lint issues and enforce lint gate - #6
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
前端
pm run lint\(eslint . --ext .ts,.tsx --max-warnings 0)存量 29 errors + 17 warnings,CI 中 lint 长期 continue-on-error。本次把 lint 清零并将 CI 的 lint 提升为硬门禁。
改动分类
错误修复(29 errors)
outerConfig.tsx\(router.tsx 只留 4 个路由守卫组件,App.tsx import 更新);ui/badge、ui/button 的 cva variants 与 ui/form 的 useFormField 属 shadcn 标准结构,按社区通行做法对具体导出行加行级豁免并附原因
warning 修复(17 处 exhaustive-deps)
uns = pageData?.records || []\ 用 useMemo 包裹(逻辑表达式每次渲染新引用会破坏下方 useMemo)
死代码清理
CI
验证
pm run lint\:0 problems(0 errors, 0 warnings)
pm run test\:16/16 通过(useStreamResponse 6 / chatStore 6 / ChatInput 4,chatStore 的 selectSession finally 重构有 6 个用例覆盖)
pm run build\:通过
px tsc -b\:0 errors(移除 @ts-nocheck 后全仓类型检查干净)
需要人工复核的点