daniel-beet / vsc-sort-imports

Sort ES6 imports automatically.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sort-imports

Sort ES6 imports for JavaScript and TypeScript automatically. Ported from the atom-import-sort package by Renke Grunwald.

Sort Example

Features

Automatically sorts imports on save. You can disable this behavior in the settings and sort imports manually:

  1. Launch the Command Palette (Ctrl/Cmd + Shift + P);
  2. 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:

  1. Launch the Command Palette (Ctrl/Cmd + Shift + P);
  2. 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 the eslint style.

2.2.0

  • Added setting to suppress warnings. Set sortImports.suppressWarnings to true to hide warnings if sorting imports fails.

2.1.0

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

About

Sort ES6 imports automatically.

License:ISC License


Languages

Language:TypeScript 100.0%