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
I added file called .prettierrc
in my project folder.
File content:
{
"singleQuote": true,
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true
}
}
}
It looks like it is a bug open for this issue: Prettier Bug
None of above solution worked for me. The only thing that worked was, adding this line of code in package.json:
"prettier": {
"singleQuote": true
},
quote_type = single
add this inside .editorconfig
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
quote_type = single
Correct solution :
I add .prettierrc.js file in my main root project and write
module.exports = {
singleQuote: true
};