chore(frontend): 消融 4 个必红且零消费者的 format 门禁——app 的 prettier --check 实测 870/1137 个被跟踪 ts/tsx 不合规、desktop 79 个,CI/Makefile/scripts/verify 从不调用;删脚本 + 2 处随之零消费者的 prettier devDep(lockfile 同步,frozen-lockfile rc=0),.prettierrc 保留给编辑器 - #2287
Merged
Merged
Conversation
… 870/1137 个被跟踪 ts/tsx 不合规、desktop 的 79 个不合规,而 CI/Makefile/scripts/verify 零调用(只有 lint/typecheck/test/coverage 是门禁),删掉 app 与 desktop 各自的 format/format:fix 脚本连同 2 处随之零消费者的 prettier devDep(lockfile 同步,frozen-lockfile 一致性 rc=0);.prettierrc 两份保留——它们的消费者是编辑器而非门禁 Co-authored-by: Cursor <cursor@vectorcontrol.tech>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
做了什么
删掉 4 个结构上不可能变红也没人看的 format 脚本,以及随之零消费者的 prettier devDep:
app/package.json"format": "prettier --check ."、"format:fix": "prettier --write ."、devDepprettier@^3.8.3app/desktop/package.json"format": "prettier --check src"、"format:fix": "prettier --write src"、devDepprettier@^3.8.3app/pnpm-lock.yamlprettier@3.8.3在 snapshots 里保留为optional: true,因为仍有传递性 optional peer 声明它)6 行删除 + lockfile 9 行变化,0 行 TS/源码/测试改动。
为什么这是死门禁而不是待修的门禁
实测(主机在 master =
dfbe476e上跑):零消费者:
即:这个检查在仓库里从来不会执行,而一旦执行必然红。round-69 的 #2278 处理的是同一类东西(「结构上不可能变红」的 lint step)——那边能翻成真门禁是因为只差 6 个
no-explicit-any;这里差 870 个文件,翻成真门禁等于一次全仓重排版。为什么不用「排版修好它」:对 870 个文件跑
prettier --write会产生一个远大于全部产品代码的 diff、抹掉这些行的 blame,并且把「本仓前端风格」这个设计决定伪装成一次清理。要不要真的采纳 prettier 当门禁(并配套.prettierignore+ 一次性重排版 + CI step)属 operator 决策,已记入本轮报告,不在本 PR 里偷偷做。为什么保留两份
.prettierrc/.prettierrc与app/desktop/.prettierrc的消费者是编辑器(VS Code 的 prettier 扩展自带 prettier,读仓库配置),不是仓库门禁。删掉它们的后果是具体的:format-on-save 的人会静默切到 prettier 默认(双引号 / 80 列),与现有树更不一致。所以本 PR 只拆掉「假门禁」,不动「真约定」。证据
诚实边界:worktree 的
app/*/node_modules是指向主 checkout 的 symlink,没有在本机跑真安装(那会在会话中途改共享树、影响其它 worktree 与在跑的 dev-web),所以「prettier 从 node_modules 消失后一切照旧」这一条由 CI 的 freshpnpm install --frozen-lockfile+ 前端全量 job 兜底,本机只证到 lockfile 一致性与零引用。Negative constraints
.ts/.tsx/.css、没重排版任何文件、没加.prettierignore(加了也只是让一个仍会红的检查红得少一点)。lint/typecheck/test/coverage任何一条真门禁,也没动scripts/verify/quality-debt-baseline.json(本 PR 不涉及continue-on-error变化)。prettier字面量(chatview 工具标签、i18n 文案、demo 夹具)与本 PR 无关,未触碰。