Skip to content

Type-only default+named imports #16

@robpalme

Description

@robpalme

Hegel and Flow support type-only imports of the default binding with named bindings like this:

// default import with named import
import type defaultBinding, { otherBinding } from "module"    // Error in TypeScript

The above is not supported by TypeScript: A type-only import can specify a default import or named bindings, but not both.

The workaround for TypeScript is to use an alias.

// default import with named import
import type { default as defaultBinding, otherBinding } from "module"

Should we widen the type-only import syntax to account for handling both immediate default imports and named imports?

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