frxncismor / custom-group-import-sorter

Sort your imports as custom groups

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Group Import Sorter

Sort your imports as custom groups

In Typescript you can select multiple lines of imports and sort them in groups.

Install

Click the extension tab and in there search Custom Group Import Sorter and install it. Or just go to Custom Group Import Sorter.

How to Use - Configuration

Go to Settings Custom Group Import Sorter open settings.json and add 3 custom arrays in there put the origin that you want to group.

"custom-group-import-sorter.Group1": [
  "@angular"
],
"custom-group-import-sorter.Group2": [
  "rxjs",
  "@ngrx/store"
],
"custom-group-import-sorter.Group3": [
  "@library/core",
  "@library/data"
]

So the output will be

Screen Shot 2024-01-22 at 4 44 04 p m

Note

Any library that doesn't exists in the groups will be sorted at the bottom.

Warning

Only select your imports or any other code selected will be removed.

How to Use - Execution

  • Select the desired ones.
  • Using Command Palette Cmd+Shift+P and select Custom Group Import Sorter: Sort.

Or you can create a shortcut for this command in Keyboard Shortcuts in VS Code.

License

MIT © Frxncismor


Code Inspiration

custom-css-sorter

About

Sort your imports as custom groups

License:MIT License


Languages

Language:TypeScript 65.2%Language:JavaScript 34.8%