[BUG]: Cannot resolve `Lib.*` and `Drawing.*` methods
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- developer-experience
Hướng nghiên cứu
Review src/lib/index.js and src/components/drawing/index.js, then inspect src/plots/cartesian/transition_axes.js for the reported unresolved symbols. Reproduce the PyCharm warnings and check whether the same export pattern affects other modules. Done when the reported Lib., Drawing., setTranslate, and setScale references resolve without changing runtime behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
PyCharm reports methods imported from https://github.com/plotly/plotly.js/blob/main/src/lib/index.js as unresolved, for example:
var Lib = require('../../lib');
Lib.coerce(...)
Lib.coerceSelectionMarkerOpacity(...)
I get:
Unresolved function or method `coerce()`
Unresolved function or method `coerceSelectionMarkerOpacity()`
This makes development difficult because IDE navigation to the lib methods does not work.
The issue comes from this assignment:
https://github.com/plotly/plotly.js/blob/f618df5fe66945df1a165d04dfe19b91f724f927/src/lib/index.js#L13
The static analysis doesn't like it.
Changing it to:
- var lib = (module.exports = {});
+ module.exports = {};
+ var lib = module.exports;
allows PyCharm (or maybe other IDEs?) to correctly resolve the exported methods.
The same problem also occurs in:
https://github.com/plotly/plotly.js/blob/f618df5fe66945df1a165d04dfe19b91f724f927/src/components/drawing/index.js#L23
I get:
Unresolved variable setTranslate
Unresolved variable setScale
And there are more.
- Ngôn ngữ chính
- JavaScript
- Star
- 18.3k
- Fork
- 2k
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 30
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của plotly/plotly.js
-
chore P3 plotly-internal size: 3 task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
-
bug P2 size: 1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
chore P1 plotly-internal size: 1 task
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
chore P3 plotly-internal size: 1 task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Tất cả issue của plotly/plotly.js
Issue tương tự
-
bot:ai-assisted component:compact-js status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
midnightntwrk/midnight-sdk#403 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
DavidAnson/markdownlint-cli2#940 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100