When I execute a Format Document
command on a Vue Component.vue file VSCode replace all single quoted string with double quoted string.
In my specific case
For newbies like me:
From the menu Nav bar at the top: Select File -> Preferences -> Settings. In the search text box, type in Quote In the filtered list that appears below, look for the gear icon and next to it - "Prettier". Click on check box to enable "Prettier: Single Quote"
It works for me to check single quote in Prettier as well tslint.autoFixOnSave as true
Well for me both options solved the issue:
By adding inside the .prettierrc - "singleQuote": true
Or by adding following inside the package.json -> "prettier": { "singleQuote": true }
Though I tried also adding .prettierrc.js
and have following
module.exports = { singleQuote: true };
This didn't worked.
For JSX use:
{"jsxSingleQuote": false}
Install prettier extension and paste below code in your VSCode settings.json
file
"prettier.useEditorConfig": false,
"prettier.singleQuote": true
this will ignore your .editorconfig
file setting.
For projects that use .editorconfig
file by default. The formatter will ignore the rules in the settings and use the rules in .editorconfig
, then you can either:
.editorconfig
file, and use your VSCode settings.quote_type = single
to the .editorconfig
file regarding your file type. You can also set quote_type
value to double
or auto
.