Visual Studio Code - Adjust import quotation setting

Solution 1:

As of VSCode 1.10, this is (sadly) not possible yet. But is an issue for a lof of the users as it seems. The VSCode theme is aware of this issue and you can follow this to know when it is implemented: https://github.com/Microsoft/TypeScript/issues/13270


Update June 2018

Since VSCode 1.24 (June 2018) there is an option for this!

"typescript.preferences.quoteStyle": "single"

For more info see:

https://code.visualstudio.com/updates/v1_24#_preferences-for-auto-imports-and-generated-code

Solution 2:

You can also configure the below line in your vscode user settings to adjust this setting.

"prettier.singleQuote": true

Solution 3:

I fixed that using Editor config, open your .editorconfig file in your project root directory (if you don't have, create that file) and add this line after the [*]

[*]
...
quote_type = single

In the wiki you can see the complete list of properties.

Solution 4:

As of VS Code 1.21.1 you need to edit

/usr/share/code/resources/app/extensions/typescript-basics/snippets/typescript.json

In Windows

/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-basics/snippets/typescript.json.

In Windows 10 (vscode version 1.30.* (user setup) later)

*C:\Users\<yourusername>\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-basics\snippets\typescript.json

In the 'Import external module' section of that file make the body array property to be the value "import { $0 } from '${1:module}';" The section will then look like this:

"Import external module.": {
    "prefix": "import statement",
    "body": [
        "import { $0 } from '${1:module}';"
    ],
    "description": "Import external module."
},