Using Prettier extension in VSCode.
Have the Single Quote set to single.
format onSave is set to true.
Still... When I hit save, single quotes are converted to double..
WHY? WHY? WHY? WHY?
In addition...
// in .eslint file
"quotes": [2, "single", { "avoidEscape": true }],
Still... When I hit save, single quotes are converted to double..
I've traced the source of the problem.
It appears there are levels of configuration that will be checked when VSCode attempts to reformat the text when format on save is checked.
.eslintrc.editorconfigI'm still not sure in what order they run in, thus who has the final say.
But in my case, a VERY basic .editorconfig was the problem. Deleting this file fixed it.
# EditorConfig https://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
In the file above there is no mention of spacing prefs at all. So I'm assuming there are some defaults to double quotes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With