Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change auto import format in WebStorm

I'm using WebStorm 2016.3 and currently working on typescript based project.

Right now auto import will generate something like this:

import {xxx} from "yyy"

I want to change the format to

import { xxx } from 'yyy'

How do I do this?

like image 383
Daniel W Avatar asked Dec 14 '16 11:12

Daniel W


People also ask

How do I change import settings in Intellij?

You can change the settings to import entire packages instead. In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Editor | Code Style | Java | Imports. Clear the Use single class import checkbox, and apply the changes.

How do I sort imports in Webstorm?

If we want to go a step further and sort the imports, we can go to Preferences / Settings | Editor | Code Style | JavaScript or TypeScript and select Sort imports by modules on the Imports tab.

How do I disable optimize imports in Intellij?

Disable File | Settings | Editor | General | Auto Import | Optimize imports on the fly. Normally you don't need to add imports manually, IDEA does it for you.

How do I turn off auto import in Vscode?

To disable auto imports, set "javascript.suggest.autoImports" to false .


2 Answers

2016.3.*:

  • in Settings | Code Style | Typescript | Spaces, enable Within / ES6 import/export braces

  • in Settings | Code Style | Typescript | Other, set Quote marks: to Single quotes

2017.1.*:

  • in Settings | Code Style | Typescript | Spaces, enable Within / ES6 import/export braces
  • in Settings | Code Style | Typescript | Punctuation, set Use to single
like image 77
lena Avatar answered Oct 06 '22 16:10

lena


You can change this in:

Settings | Code Style | Typescript | Other

Select Single quote for Quote marks in Generated code section

like image 29
Aleksey L. Avatar answered Oct 06 '22 15:10

Aleksey L.