"prettier.singleQuote: true" not being honored for vanilla javascript files
See original GitHub issueI am having an issue getting the vscode prettier extension to convert my javascript documents correctly. I am running VSCode 1.22.2 with version 1.3.1 of the Prettier extension.
I have a prettier configuration set to convert double quotes to single quotes using the "prettier.singleQuotes": true
setting. I have this setting set in both visual studio’s user setting in .prettierrc
within my project.
When I format my VueJS files, this setting is getting honored for any javascript contained in my <script>
body in those files. But for vanilla javascript module files, my single quotes are getting replaced with double quotes. I do not have any other code formatters installed. Here is a snippet of my User configuration:
// Force single quotes
"prettier.singleQuote": true,
Here is my code before I click on “Format document”:
console.log('Hello World');
Here is what it looks like afterwards:
console.log("Hello World");
This breaks our organization’s linting standards, which is forcing me to manually search/replace all occurrences of an errant double quote with single quotes, so any pointers would be greatly appreciated. Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Did a bit more testing. As it turns out, it looks like all my formatting rules are being ignored for javascript files, not just the single quote rule. I do not have any languages or extensions disabled in my prettier config.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.