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
Can we enable the dangling comma on this project? #3469
Comments
Prettier should probably use Prettier's defaults... |
That's what I thought.. but not really.. :) The default I guess comes based on popularity or what people wanted in a first place, but the world is evolving and maybe we can teach them the right way :P Also if it's a hard requirement for this project to use the default values, let's change the default value :D Either case, having the dangling comma has more pros than cons.. |
Please don't change the defaults without making a major version bump. I don't see much reason for Prettier to always stick with the defaults, though, except those reasons that would apply to any other project (e.g. "use prettier's defaults" is the easiest rule which minimizes style bikeshedding). |
No I don't think that changing the default is the way to go.. Like I already mentioned.. there is no real need for Prettier to use the default.. we can adjust to what we want for the project. |
Trying to make it clear: @lipis wants to change the Prettier settings we use for the Prettier codebase (i.e. only an internal thing) |
Yes! I (hopefully more) want to enable the following on the Prettier codebase: trailingComma: all |
We certainly can't set it to Prettier should be configuration free by default. Running Prettier on Prettier with Prettier's own defaults seems like it has more advantages. Don't want people to look at the Prettier source as an example and think that a config file is required. |
For what it's worth, node v4 will become EOL in April, so I imagine this might not be a blocker at that point.
I'm not sure about the context of this, but Prettier did have it's own In general, I agree with @bakkot above: we shouldn't change the defaults without a major version bump, but I don't see an intrinsic reason why Prettier itself should use them. On the other hand, the benefits of trailing commas are pretty well-described (as in the OP, for instance). |
Prettier is already using the |
Those are good points: we could use "es5" as a way to have more trailing commas without losing node v4 compatibility; and having a However, since we're using |
This addresses prettier#3469 as outlined in prettier#3469 (comment) The corresponding formatting changes will be done separately for clarity's sake.
This addresses prettier#3469 as outlined in prettier#3469 (comment) The corresponding formatting changes will be done separately for clarity's sake.
Don't use eslint-plugin-prettier's config, that should be considered deprecated as it breaks formatters like Prettier-VSCode and Prettier-Atom which use the |
I honestly think this is complete bikeshedding. I personally prefer trailing commas but that's not the point. The very reason this project exists is to remove discussion about code style, and this issue is doing the exact opposite on Prettier's own source code. Changing Prettier's own formatting to something that isn't the default will cause more discussion in other projects adopting Pretter. "Should we use the defaults or use Prettier's settings?" |
This reverts commit 0b22329. This addresses the following: * prettier#3492 (comment) * prettier#3469 (comment)
Alternative proposal: do nothing for now, and then when Node 4 hits EOL, change the default to Downside is that it would mean people writing untranspiled code for non-current browsers and Node would start needing to configure prettier. And the major version bump, of course. EDIT: never mind; node 6 also doesn't support trailing commas in functions, and it's not EOL until 2020. I guess we could switch to |
Going to close this and recommend discussion in #3503 |
Because even though one line was added, two were deleted and that's confusing when reviewing.
Also if you would like to sort them, you would have to manually add the missing comma, because the there will be a syntax error if the last item will move in the middle.. (if someone will mention that these things are handled by Prettier 😃)
More reasons can be found here: https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8
The text was updated successfully, but these errors were encountered: