Skip to content

Do not generate a default export for files containing only snippets #15843

Open
@Thiagolino8

Description

@Thiagolino8

Describe the problem

After the export of snippets was allowed, it became common practice to use .svelte files only to export snippets, containing only the snippets, the module script and optionally the style tag
Even though it does not contain any code related to the file's component, its default export is still generated, which is not only useless code but also pollutes the module's typing

import * as everything from './snippets.svelte'
const { default: comp, ...snippets } = everything // Now the typing of snippets is { whatever: () => ReturnType<import("svelte").Snippet> }

Describe the proposed solution

Do not generate a default export for files containing only snippets

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions