Should we use trailing commas in Kotlin code? #3461
Closed
mnonnenmacher
started this conversation in
Polls
Replies: 3 comments 1 reply
-
FYI, these are the respective Ktlint rules that Detekt uses. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Btw, this would also be easy to change for the UI code if wanted, just set |
Beta Was this translation helpful? Give feedback.
1 reply
-
As there was no majority for enabling trailing commas, we will keep the current configuration. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In frontend TypeScript code we use trailing commas, but we do not use them in Kotlin code. This can be a bit confusing when working on both parts of the code.
IMO the main benefit of trailing commas is that it reduces the diff when adding an item to the end of a list.
Please share if you would like to enable trailing commas in Kotlin code as well or prefer to keep it as is. If the vote is positive in a week, I will configure the respective Detekt rules accordingly.
6 votes ·
Beta Was this translation helpful? Give feedback.
All reactions