Closed joboyx closed 3 years ago
This may be an issue with the prettier VS Code extension or your config, as in the generated project there's already a setting in package.json
for prettier with "singleQuote": true
. You can verify that it works fine by running npm run prettier
from the command line.
It would be ok to enforce the quote_type
property in editorconfig, but at the moment it's a proposal and not an "officially" supported property (see https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties).
I also tried with a freshly generated project where I enabled the "prettier" option and the formatting is fine, using the settings from package.json
(single quotes).
Are you sure you enabled the "prettier" option when generating your project, and you're using this extension for formatting?
I just saw that quote_type = single
was added to the default ng11 generated app, so I wouldn't hurt to also add it.
:tada: This issue has been resolved in version 9.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I'm submitting a...
Current behavior
Using prettier as formatter in VSCode, format whole .ts typescript file makes all single-quote (') as double quotes (")
Expected behavior
Expected is that when organizing imports and formatting document all quotes should be single
Minimal reproduction of the problem with instructions
Environment
Others:
ℹ️ WORKAROUND
.editorconfig
withI think as a fix, this manual change to
.editorconfig
should be included in the boilerplate/generated code by ngx since in previous versions single quote is used by default (I think by prettier in package.json)(that's what I get used, unless this changed). So this might be a regression issue.