-
-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
singleQuote config is not respected #206
Comments
Do you have other formatters enabled or eslint integration? |
Is there a single quote in your string ? |
I do have eslint and Standard style enabled: @CiGit no it changes all strings, no matter if they have a single quote or not |
Try disabling those extensions. |
JSX props are always double quoted. see prettier/prettier#656 |
@CiGit thanks 😔 |
Hi, Im getting this issue however in my case double quotes are also being applied to normal javascript/ .js files too. I have disabled eslint but no change to the behaviour. My prettier .prettierrc config:
I have also tried moving the prettier config setting into the package.json file to see if it gets picked up from there, but no effect. I also noticed that on save trailingComma are also being removed. It seems like prettier-vscode is not reading the config setting... My VS Code Version: 1.17.0 |
I am also facing the same problem, |
vscode is not honoring the |
@rc-chandan Can you open a new issue ? this seems not related to this one. @dfinton singleQuote has some rules see https://prettier.io/docs/en/options.html#quotes |
This really bugs me, why won't they allow devs to configure the way they want. Makes me want to make a whole new plugin just because of this one issue, which they won't fix. |
@divyamamgai problem is still actual... |
I'm having this same issue. I have enabled single quote everywhere I can: prettier, eslint, tslint, vscode user settings... yet it STILL converts the single quote to double. It even underlines the doublequote as incorrect. |
@JollyGrin Creating a .prettierrc.json got it working for me, looks like it isn't respecting this setting from vscode settings.
|
The behavior of using the values of prettier config or editor config INSTEAD of VS Code settings is BY DESIGN. Please see discussion here on why it wouldn't make sense to do merge the settings: #1099 (comment) |
@ntotten Don't know who you are replying to but in my case I had no prettier config or editorconfig, only vscode settings and prettier was converting all my single quotes to double quotes, moving this config to prettier config worked for me. I never said anything about merging settings. |
@asegarra Please open a new issue with the log and such if you can. I'd like to figure out what is happening. |
Same here.... since Prettier updated, double quotes everywhere, even though in user settings I have set up singleQuote: true. |
I have the same problem, in that single quotes are converted to double despite my prettier vscode settings being for single quotes. @asegarra's solution worked for me. |
Well, in this project I cannot use prettier config, and I would prefer to have my code settings affect prettier setup. Hopefully it can be fixed by prettier team. edit: In the end, I put .prettierrc in parent folder so I don't have to commit, and it works. |
@PerpetualWar if you can’t use a prettier config, one option in addition to what you did is to disable using editorconfig. In which case no project config should be detected and the VSCode settings will be used. That being said, the route you took is also a good option. |
Oh, I haven't realized it's the editorconfig that is taking priority ... It must be new addition, since it wasn't affecting codebase before latest update... but now I'm fine when I know where the problem is. Thanks! |
Fixed by adding |
I already have this property in my settings.json and it still isn't respecting it |
Combine it with |
I am using typescript-eslint. Isn't that more modern? Either way, I discovered my problem was with the Prettier extension. It doesn't work in a way that eslint's rules will accept. More context on that here: https://stackoverflow.com/questions/60821494/visual-studio-code-does-not-respect-my-eslint-quote-rules |
I deleted |
I always get my code with double quotes, even when I have
set.
The text was updated successfully, but these errors were encountered: