Skip to content

[CHORE]: Cannot resolve Lib.* and Drawing.* methods #8060

Description

@Lexachoc

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogchoreTrack maintenance work (dependency bumps, build/CI, internal refactors, docs, etc.)plotly-internalsize: 1taskone-off task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions