Skip to content

Typescript auto-import put comma in wrong position #40219

Closed
@chengB12

Description

@chengB12

TypeScript Version: 4.1.0-dev.20200823
Visual Studio Code Version: 1.48.1

Search Terms: import comma

Code

import { Foo1,
   Foo2, Foo3,
   Foo4, Foo5,
} from 'foo'

export default {
     foo6: {} as Foo6
}

Expected behavior:
When prompted Quick Fix => click "Add 'Foo6' to existing import declaration 'foo', and click auto-import
The import declaration shall be

import { Foo1,
   Foo2, Foo3,
   Foo4, Foo5, Foo6,
} from 'foo'

Actual behavior:

import { Foo1,
   Foo2, Foo3,
   Foo4, Foo5,, Foo6
} from 'foo'

image
image

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions