fix(knowledge): 图谱可视化回调参数补类型,修复 TS7006 构建失败 - #102
Open
tianling536 wants to merge 1 commit into
Open
Conversation
cy.nodes()/edges() 的 forEach/filter 与 tap 事件回调参数补 NodeSingular/EdgeSingular/EventObject 类型(隐式 any 在严格 tsc 下报错, 纯净 main 的 npm run build 即失败)
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.
问题
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)。验证
npm run build通过(仅 chunk 体积提示)。