Skip to content

fix(knowledge): 图谱可视化回调参数补类型,修复 TS7006 构建失败 - #102

Open
tianling536 wants to merge 1 commit into
OpenBMB:mainfrom
tianling536:fix/kg-viz-implicit-any
Open

fix(knowledge): 图谱可视化回调参数补类型,修复 TS7006 构建失败#102
tianling536 wants to merge 1 commit into
OpenBMB:mainfrom
tianling536:fix/kg-viz-implicit-any

Conversation

@tianling536

Copy link
Copy Markdown
Contributor

问题

KnowledgeGraphVisualization.tsx 的 cytoscape 回调参数缺少类型标注,严格 tsc 下报 TS7006(implicit any),导致纯净 main 上 npm run build 直接失败:

  • cy.nodes().forEach((node) => ...)(832 行)
  • cy.nodes().filter((node) => ...)(597 行)
  • cy.edges().forEach((edge) => ...)(604 行)
  • cy.on('tap', ...) 两处(573 行等)

修复

按 cytoscape 官方类型标注:NodeSingular / EdgeSingular / EventObject(从 cytoscape 包导入类型,非 any)。

验证

  • 修复前:纯净 main worktree 同样报这 5 处 TS7006;
  • 修复后:npm run build 通过(仅 chunk 体积提示)。

cy.nodes()/edges() 的 forEach/filter 与 tap 事件回调参数补
NodeSingular/EdgeSingular/EventObject 类型(隐式 any 在严格 tsc 下报错,
纯净 main 的 npm run build 即失败)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant