Invalid typing probably?
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
先比较 types/element.d.ts 和 types/label.d.ts 中的 EventContext 与 label 定义,然后检查 test/fixtures/ellipse/label-dynamic.js 中引用的测试 fixture。确认 EventContext.element.label.options 是否允许示例中使用的属性,尤其是 content;当类型定义与既有用法匹配且相关类型检查通过时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Hello again!
I saw lot's of usage of EventContext.element here and there in examples and tests.
e.g. [here](https://github.com/chartjs/chartjs-plugin-annotation/blob/ebd5c6f9c2f56dcf1cf213aa7af2a9e93d38059f/test/fixtures/ellipse/label-dynamic.js#L34C1-L35C1:
element.label.options.display = true;
But in typings I see that label is marked as AnnotationElement here.
Idk, did I understand it correctly, but I believe it should be CoreLabelOptions or smth similar?
I believe typing checker or eslint passes successfully because lot's of properties have the same name. But if you try to replace the code in the example above to:
element.label.options.content= "new label text";
you'll see an error since element.label.options is not type of AnnotationOptions
But maybe that's just things are mixed up in my head a bit 🙂
- 主要语言
- JavaScript
- 星标
- 625
- 派生
- 377
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
chartjs/chartjs-plugin-annotation 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 48/100
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
TypeScript type issues可能已有人在做 @joshkel 于 469 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 38/100
查看 chartjs/chartjs-plugin-annotation 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
Fei2411/DeepSeek-Bot#1113 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
arfct/timezone.fyi#19 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
fastify/fastify-http-proxy#493 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
eliasstravik/herdr-projects#785 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
tensorflow/tfjs#8754 ·