Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upWhy the options are not consistent with `prettier` core? #428
Comments
This comment has been minimized.
This comment has been minimized.
Sorry about the confusion! If they were the same option, you would not be able to have both single quotes in Ruby and double quotes in JavaScript. Also, the JavaScript ones have more options that don't make sense in a Ruby context. So I've had to differentiate them. I've also gone with "prefer" since in some cases you have to use double quotes (for interpolation), so it means something slightly different. |
This comment has been minimized.
This comment has been minimized.
@kddeisz No, |
This comment has been minimized.
This comment has been minimized.
@kddeisz https://prettier.io/docs/en/configuration.html#configuration-overrides Official documentation. |
This comment has been minimized.
This comment has been minimized.
And also, the default option value should not be different with |
This comment has been minimized.
This comment has been minimized.
Okay a couple of things to respond to here. Yes, prettier supports overrides, but that means that for people to configure the ruby plugin, they'd have to override every type of ruby file in their config instead of just changing one option. Not a very good user experience there. Second of all, some of the options don't even make sense for ruby. For example, prettier has a trailing commas option, which could potentially match up with ruby's, but one of the options for configuration is "es5", which means nothing in the context of Ruby. So they would again have to go and override everything and it would be very confusing. Finally, as for matching up to the prettier defaults, the only one that it makes sense for that is quotes. In this case, for the prettier plugin I've decided to go with single quotes if you don't need interpolation and double if you do, which matches up with rubocop and rufo standard configuration. That's what the ruby community has generally settled on for "most popular". While that doesn't match up with prettier's default, I think it makes more sense to defer to the ruby community than the javascript community when configuring a ruby formatter, regardless of which language is actually doing the formatting. I appreciate your opinion on this, but the quotes default is not going to change. |
This comment has been minimized.
This comment has been minimized.
{
"overrides": [
{
"files": "*.rb",
"options": {}
}
]
} Is that really complicated? And if all plugins add a new option instead of extending core's, why Now that
Again, About quotes, I'm fine to have different default with core. Actually I'm a newbie in ruby community who prefer single quotes for all files but just using So it seems that Homebrew prefers different quote style with |
This comment has been minimized.
This comment has been minimized.
@kddeisz Any further discussion? |
This comment has been minimized.
This comment has been minimized.
Thanks for the input @JounQin. I'll keep it in mind going forward. I'm going to stick with the options I've configured for now, but I'll look into what it would mean to go entirely with the overrides option. |
As title.
I tried
singleQuote: false
but failed, and I found it was named aspreferSingleQuotes
, why???