A demo project that implements the @trivago/prettier-plugin-sort-imports plugin for Prettier that autosorts your imports.
- Install
@trivago/prettier-plugin-sort-imports
as a dev dependency - Add
"plugins": ["@trivago/prettier-plugin-sort-imports"]
in your.prettierrc
file - Configure your import order with the
importOrder
property. - Set
importOrderSeparation
totrue
if you want an empty line between the import groups. - Set
importOrderSortSpecifiers
totrue
if you want to auto sort named imports as well.