Vscode: TypeScript: Provide setting to organize imports on format

Created on 24 Apr 2018  路  5Comments  路  Source: microsoft/vscode

Testing #48150

This would be awesome.

feature-request javascript typescript

Most helpful comment

Hi guys

It is really annoying that my prettier have conflict with auto organize imports.
@mjbvz
Could you please tell if you have any progress on it?

As workaround I use

"editor.formatOnSaveTimeout": 1000

to give prettier a chance to make correct formatting.

All 5 comments

I know we have the setting for organize import on saving, on import will be great, but can we please have it respect the formatting and not create a line over 140 chars wide, or a setting to define that please?

Would love this action to happen _before_ formatting, since may users use prettier. Currently, I organize imports (which does not respect prettier formatting rules) and then format with prettier (manually or onSave)

The Typescript Hero has a function to set the import group, but it is still relatively simple and can be used as a reference.
https://github.com/buehler/typescript-hero/wiki/Features
https://github.com/buehler/typescript-hero/issues/462

I agree with @ZSkycat. I am currently using TypeScript Hero, but since most of the features are now included in TypeScript itself, I would like to work without that extension.
The only thing that seems to be missing right now are some features of the "organize imports":

  • Import grouping
  • Multi-Line imports

Hi guys

It is really annoying that my prettier have conflict with auto organize imports.
@mjbvz
Could you please tell if you have any progress on it?

As workaround I use

"editor.formatOnSaveTimeout": 1000

to give prettier a chance to make correct formatting.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryan-wong picture ryan-wong  路  3Comments

borekb picture borekb  路  3Comments

DovydasNavickas picture DovydasNavickas  路  3Comments

lukehoban picture lukehoban  路  3Comments

mrkiley picture mrkiley  路  3Comments