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:
|
var lib = (module.exports = {}); |
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:
|
var drawing = (module.exports = {}); |
For:
|
.call(Drawing.setTranslate, 0, 0) |
|
.call(Drawing.setScale, 1, 1); |
I get:
Unresolved variable setTranslate
Unresolved variable setScale
And there are more.
PyCharm reports methods imported from https://github.com/plotly/plotly.js/blob/main/src/lib/index.js as unresolved, for example:
I get:
This makes development difficult because IDE navigation to the lib methods does not work.
The issue comes from this assignment:
plotly.js/src/lib/index.js
Line 13 in f618df5
The static analysis doesn't like it.
Changing it to:
allows PyCharm (or maybe other IDEs?) to correctly resolve the exported methods.
The same problem also occurs in:
plotly.js/src/components/drawing/index.js
Line 23 in f618df5
For:
plotly.js/src/plots/cartesian/transition_axes.js
Lines 41 to 42 in f618df5
I get:
And there are more.