ggascoigne / prettier-plugin-import-sort

Prettier plugin to pass javascript and typescript through import-sort
MIT License
110 stars 11 forks source link

Bug: Duplicated commented imports #13

Closed dawsbot closed 4 years ago

dawsbot commented 4 years ago

Running prettier on a file with a comment as the last import duplicates that comment

image

the axios import is multiplied each time I run prettier

This applies to not just imports, it occurs for any comment which immediately follows your imports without a blank line in-between


Run prettier once

image

Run prettier three times

image

The commented out imports also multiply

Repro Steps

  1. Create a .tsx file where the last import is commented out
  2. npx prettier --write FILE_NAME on a file where the imports end in a commented out import
ggascoigne commented 4 years ago

This bug actually belongs over on the https://github.com/renke/import-sort repo.

dawsbot commented 4 years ago

Thanks @ggascoigne, here you have it https://github.com/renke/import-sort/issues/118

jerome-benoit commented 4 years ago

I fail to see how that issue is belonging to import-sort: it properly left alone commented import lines without duplicated them. That issue belongs to that repository.