Skip to content

Feature request: Allow to combine default type import with named importsΒ #61972

Closed as not planned

Description

πŸ” Search Terms

default named type import

βœ… Viability Checklist

⭐ Suggestion

Allow to combine default type import with named imports in a single statement.

πŸ“ƒ Motivating Example

All these lines are valid syntax:

import def from "m";
import def, { name } from "m";
import def, type { T } from "m";
import def, { type T } from "m";
import type D from "m";

These lines should be valid syntax as well:

import type D, { name } from "m";
import type D, type { T } from "m";
import type D, { type T } from "m";

πŸ’» Use Cases

  1. What do you want to use this for? Shorter code, consistency.
  2. What shortcomings exist with current approaches?
  3. What workarounds are you using in the meantime? Separate imports.

Activity

  1. jakebailey commented on Jul 1, 2025

    @jakebailey
    Member

    IIRC this was intentional, e.g. it's visually confusing that your first example is not type-only and will actually emit a runtime import:

    import type D, { name } from "m";
  2. RyanCavanaugh commented on Jul 7, 2025

    @RyanCavanaugh
    Member

    This was indeed intentional, see the implementing PR #35200. In our judgment, the confusion of what this means is not worth the brevity.

  3. typescript-bot commented on Jul 10, 2025

    @typescript-bot
    Contributor

    This issue has been marked as "Declined" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

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

    DeclinedThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions