chore(types): 删除手写 react-syntax-highlighter/@lobehub/icons ambient 重复声明,收敛至官方 @types - #2184
Merged
Merged
Conversation
- 删 app/web/src/vendor-types.d.ts 整文件(RSH 17 子模块块 + @lobehub/icons 根模块块,均零消费或已被官方类型覆盖) - 删 app/desktop/src/vite-env.d.ts 中 RSH 16 子模块手写块,保留 vite/client 引用 - 官方 @types/react-syntax-highlighter@^15.5.13 已装(1133 declare module),覆盖全部实际导入路径 - 手写块已漂移:真实在用 jsx 两份都缺、从未导入的 java/kotlin/swift 声明两份 - #2154 前端遗留候选 C(round-38 探索取证) 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.
Summary
删除 web
vendor-types.d.ts与 desktopvite-env.d.ts中手写的react-syntax-highlighter/@lobehub/iconsambient 声明(-122 行),类型全部收敛至已安装的官方@types/react-syntax-highlighter@^15.5.13。#2154 前端遗留候选 C(round-38 探索取证,推荐项)。动机(取证)
app/package.json:45已装@types/react-syntax-highlighter(1133 个declare module),web tsconfig 无types限制自动纳入;手写块的每一行都是重复。jsx(shared/src/ui/prismRegistry.ts:20)两份手写声明都缺;从未被导入的java/kotlin/swift却在 web 版声明(死声明);两份拷贝彼此失同步(17 vs 16 子模块)。@lobehub/icons根模块声明是死的:全仓无根导入(生产全走深路径@lobehub/icons/es/*,shared/src/ui/RuntimeIcon.tsx),仅测试vi.mock不需要类型。Scope
app/web/src/vendor-types.d.ts(整文件 104 行)app/desktop/src/vite-env.d.ts手写 RSH 块(保留/// <reference types=\"vite/client\" />)验证证据(本地)
pnpm --filter agenthub-web typecheck(tsc -p tsconfig.json)✅pnpm --filter agenthub-desktop typecheck(tsconfig.app.json,含types: []限制)✅tsc -p tsconfig.json✅git diff --check✅风险
tsconfig.app.json有types: [],但实测删除后 tsc 全绿(RSH 导入经模块解析仍命中 @types,且 desktop app 面未直接引入 prismRegistry 链)。若 CI 出现 TS2307,回退或补/// <reference types="react-syntax-highlighter" />一行即可。