Skip to content

Add support for default exports of anonymous functions and classes #799

Description

@petermasking

Currently, default-exported functions and classes must have an identifier because our FQN generation includes the declaration name.

// path/to/function.ts
export default function run() {} // FQN: path/to/run

// path/to/class.ts
export default class Thing {} // FQN: path/to/Thing

With barrel file support, however, the FQN can now be derived entirely from the resolved export path.

// path/to/run/index.ts
export default function execute() {} // FQN: path/to/run

In this case, the declaration name is ignored, making it unnecessary overhead. We should therefore also support anonymous default exports.

// path/to/run/index.ts
export default function() {} // FQN: path/to/run

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions