Overview of @ianvs/prettier-plugin-sort-imports
mainThis Prettier plugin sorts import declarations based on a provided Regular Expression order. It improves upon @trivago/prettier-plugin-sort-imports with several additional features:
- Side-effect preservation: Does not re-order across side-effect imports by default.
- Import combining: Combines imports from the same source and merges type and value imports (when
importOrderTypeScriptVersionis set to"4.5.0"or higher). - Type grouping: Groups type imports using the
<TYPES>keyword. - Built-in module support: Sorts Node.js built-in modules to the top (configurable via the
<BUILTIN_MODULES>keyword). - Customization: Supports custom import order separation, handles comments around imports correctly, and simplifies configuration options.