import-sort icon indicating copy to clipboard operation
import-sort copied to clipboard

import-sort via prettier

Open ggascoigne opened this issue 6 years ago • 2 comments

I've always found it awkward to run import-sort and prettier in the editor since chaining these two is somewhat error prone and can easily have both running at the same time.

So I wrote a prettier plugin https://github.com/ggascoigne/prettier-plugin-import-sort that allows import-sort to run as a preprocessor to prettier. I'll admit that it's not a very sophisticated approach and could most likely be improved by trying to reuse the prettier parser, but I didn't have time for that.

Anyway, this led me to wonder if it's worth officially supporting a prettier-plugin in this repo, or whether it's better to keep it separate.

ggascoigne avatar Sep 03 '19 17:09 ggascoigne

Hi @ggascoigne

that's pretty cool! I wasn't aware that prettier now has support for plugins. I will take a closer look to learn how it works.

Your plugin being part of this repository definitely makes sense to me; at the very least we should mention it in the README.

renke avatar Sep 21 '19 15:09 renke

+1 bumping because it looks like this is outstanding.

xenoterracide avatar Jul 08 '20 14:07 xenoterracide