-
Notifications
You must be signed in to change notification settings - Fork 96
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
Respect jsxSingleQuote
#253
Comments
|
@dummdidumm I think there's been a slight confusion.
See https://prettier.io/docs/en/options.html#jsx-quotes Please reevaluate the closing of this issue. |
Oh yes I'm sorry, I got confused by the |
all good, our monkey brains were never meant to parse text anyways xd. i was thinking using |
I'm having the same issue that quotes in HTML are converted to |
I just had a quick look at the source code. I'm absolutely unfamiliar how Prettier or this plugin work. Maybe this is the faulty line? |
Yes this is probably the line (or one of the lines). The problem is that we would need to check the contents of attributes for quotes and switch them if necessary. I suspect there are quite a few people who like to use single quotes in their script tags but double quotes for attributes because that's more common for HTML. These people would get a breaking change experience because
So if we would add support for that then I think it should be a new setting, and it also shouldn't be |
You're right, I didn't think about that. However this is already a problem with the current conversion to double quotes. When I write
it will be converted by this plugin to the following broken markup
I agree that this behaviour should be configured by a new plugin-specific configuration option, not by |
I started to work on this, please see #271. However I need some help. Please have a look at my comment in the PR. |
Currently the plugin formats single quotes in html markup into double quotes regardless if
jsxSingeQuote
is set. It would be nice if the plugin would respect the setting & use single quotes in html as well.Source:
Current behaviour:
Expected behaviour:
The text was updated successfully, but these errors were encountered: