Replies: 3 comments 1 reply
-
Thanks for the suggestion. We already have something similar here where a newline after the opening i.e. local x = { 1, 2, 3 } ... written as ... local x = {
1, 2, 3 } ... will force formatting into, and keep it as ... local x = {
1,
2,
3,
} This was inspired by the original way prettier set it up. Trailing commas would be an interesting way to configure this too. Arguably maybe a bit more intuitive. However, not sure if there is value in having 2 ways to do the same thing |
Beta Was this translation helpful? Give feedback.
-
Since there is already a way to achieve something similar, my suggestion is redundant. |
Beta Was this translation helpful? Give feedback.
-
Oh, but shouldn't the same be applied to function calls then? Since we don't use trailing commas which would break them. I think that would be easier to read and "organize" at least in 2 cases:
Here are all those combinations together: I hope you agree it's a mess. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
It would mean a lot to me if trailing commas would behave similarly to Prettier and Black. I'm sure most people use them for the ease of adding items later, but I, by habit, add them when I expect a table (or even a function/class call in some languages) to be expanded by the formatter.
I would hugely appreciate an "honor_trailing_commas" option, or something similar. To be absolutely clear, what I'm proposing is to expand lines with trailing commas in addition to basic rules, NOT to ignore expanding lines without the trailing comma. So if the line is long -> expand, if there is a trailing comma -> expand at any line length.
Thanks,
Artem
P.S.: I did find a related topic in Issues, but there is no definitive conclusion except for something about... Roblox or whatnot. Sorry if I'm flogging 💅 a dead horse.
Beta Was this translation helpful? Give feedback.
All reactions