Is there a way to change from double quotes to single quotes in VS Code quick fix?
If your project has a .editorconfig
file, try adding the following line:
[*]
...
quote_type = single
I've found that the .editorconfig
file seems to override any settings for vscode, prettier, tslint, etc. and it seems to default to something other than single quotes.
Deleting the file can work as well if you don't need it.
More info on editorconfig.
You can use the Prettier Extension with the following settings (global/workspace).
"prettier.singleQuote": true
Check your tslint.json
for the quotemark
part.
If it's setted to use doublequote
by
"quotemark": [
true,
"double" < ------mention here
]
then there will be warning at your typescript
file while using singlequote
. And this will lead VS Code's quick-fix(show fix option for me) to change singlequote
to doublequote
.
So the solution should be change double
to single
.
"quotemark": [
true,
"single" < ------change here
]