[BUG]: Cannot resolve `Lib.*` and `Drawing.*` methods
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 72/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- javascript
- Domaine
- developer-experience
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- JavaScript
- Étoiles
- 18.3k
- Forks
- 2k
- Merge moyen
- 2 j 17 h
- PR mergées (30 j)
- 22
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de plotly/plotly.js
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
-
chore P3 plotly-internal size: 3 task
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
-
chore P1 plotly-internal size: 1 task
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
-
chore P3 plotly-internal size: 1 task
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Toutes les issues de plotly/plotly.js
Issues similaires
-
Update HugeIcons library Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
antfu-collective/icones#398 ·
-
ECmail.com Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
wesbos/burner-email-providers#554 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
components-web-app/docs#92 ·