WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Handling renamed default exports and declaration resolution in module references #323

@nnaydenow

Description

@nnaydenow
class Test {
    test = true;
}

export default Test;
import Test1 from "./a.js"; // Not "Test" to avoid name conflict. It must be "Test1" for this reason.

// This class, defined in a separate package, extends the base class with additional features.
class Test extends Test1 {}

export default Test;

The reference type does not indicate whether this is a renamed default export.

My question is about how this should work and what the correct usage is.

Should my reference be:

{
  "name": "default",
  "module": "a.js"
}

And if I need the declaration, should I look it up in the exports of "a.js" to find the actual declaration name before working with it?

If so, there’s a bug in the auto-merger, because it doesn’t merge parent and child declarations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions