lydell / eslint-plugin-simple-import-sort

Easy autofixable import sorting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trivago Prettier plugin sort imports integration

MattGiertl opened this issue · comments

Hey, first of all, thanks for the great package, works great!

Have you tried integrating this package with trivago/prettier-plugin-sort-imports?
I'm trying to set it up so that I don't have to run eslint fix everytime and just have prettier sort the imports for me but to no avail :(

Hi!

What do you mean integrating? You should use either trivago/prettier-plugin-sort-imports or eslint-plugin-simple-import-sort, but not both at the same time. Choose the one you like better.

Right. The initial thought was to have this plugin for the errors and prettier for the fixing 🤔 thanks for the quick answer

@lydell
Why don't use both of them and provide config that will result in the same expected output?

@AndrzejSala It’s useless to use both:

  • It’s slower. You need to run both Prettier and ESLint in CI, and having both of them do the same work is slower than having just Prettier check that your imports are sorted. And if you run both Prettier and ESLint on save in your editor, that’ll be slower too for no reason.
  • It will be a lot of work trying to make them always decide the same sorting and grouping. Lots of effort for no gain.