Skip to content

[3.8] Organize imports combines export and export type declarations #36798

Closed
@craigthompsonhive

Description

@craigthompsonhive

TypeScript Version: 3.8-rc1 / 3.9.0-dev.20200214

Search Terms: organize, organize imports

Code

// These are types
export type {
    UpdateRecognitionProps
} from "./mutations";

// These are methods
export {
    updateRecognitionCurrentUserMutation,
    updateRecognitionMutation
} from "./mutations";

Expected behavior: Organizing the import should keep type and non-type exports separate.

Actual behavior: Organizing the imports causes the two to combine into a single export {} declaration. The behaviour of whether or not it becomes an export {} or export type {} is determined by which type of export comes first. For example, in the above code the two are combined into a single export type {}, since export type is first.

Example output:

// These are types
export type { updateRecognitionCurrentUserMutation, updateRecognitionMutation, UpdateRecognitionProps } from "./mutations";

Playground Link: https://www.typescriptlang.org/play/?ts=3.8-Beta#code/PTAEBUAsFMGdtAQwE4IC4E8AOcCwAoaADywHtk1RMdQBvA0R0AVSwBNE1oAlaAY1IBzAHYBLNKNLCACslJZYBAL6gAZnIC2oAEQA6YBoCuaTpOGxtAbgIEQEGPCSpQG6Gkik2iwiXKV6+EyghuycPPxCYhJSAMKGyKjCaMzwyACyxqZSADQMTCEcXLwCIuJmGSbRwspqmjr6RpVmFtb4QA

Related Issues: #36102 (comment)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions