sort-imports
Sort ES6 imports for JavaScript and TypeScript automatically. Ported from the atom-import-sort package by Renke Grunwald.
Features
Automatically sorts imports on save. You can disable this behavior in the settings and sort imports manually:
- Launch the Command Palette (
Ctrl/Cmd + Shift + P
); - Enter Sort imports
You can also save the document without saving imports. This could become handy when you have auto saving enabled, but don't want to sort the imports in a particular file:
- Launch the Command Palette (
Ctrl/Cmd + Shift + P
); - Enter Save file without sorting imports
Extension Settings
This extension has the following settings:
sortImports.onSave
: enable/disable auto sorting on save (default: true)sortImports.suppressWarnings
: suppress warnings if sorting imports fails (default: false)
Release Notes
2.3.0
- Import sort style
module
is now included by default alongside theeslint
style.
2.2.0
- Added setting to suppress warnings. Set
sortImports.suppressWarnings
totrue
to hide warnings if sorting imports fails.
2.1.0
- It is now possible to customize the import sort style. Please refer to the import-sort documentation for more information.
2.0.0
- Added TypeScript support
- Fixed inline comments on import statements
- Thanks to @shalomdotnet for the PR!
1.1.0
- Added 'Save without sorting imports' command
1.0.0
Initial release
Thanks
- Special thanks to Renke Grunwald for creating the import-sort module!
- Icon made by Catalin Fertu from www.flaticon.com