Closed valeriangalliat closed 9 years ago
Multi-lines lists are prohibited anyway. Although I am thinking of forcing a trailing comma on maps.
Multi-lines lists are prohibited anyway.
I don't recall reading this, maybe it should be added?
Multiline's are coming - https://github.com/sass/sass/issues/216
Oh it's prohibited at Sass level. I misunderstood Hugo's comment.
Well if it's comming, we can still anticipate this!
I don't recall reading this, maybe it should be added?
I should make this clear. I don't think it is a good idea to use multiple lines for a list unless it has too many items to fit on a 80-characters long line.
I'll add this.
Added some extra content about lists. I'm still thinking about allowing/forcing trailing on maps. I can see the benefit.
You got it.
Current guidelines, about lists:
And maps:
I agree with these guidelines when the list/map fits in a signle line, but I like adding a trailing comma for multiline lists and maps. It allows to keep clean diffs when moving, appending or deleting lines, and don't require the developer (or a script) to handle differently the last line when editing code (this is annoying when using
sed
, multicursors, range substitution or macros for example).I know this is not something everybody likes, but at least the two style guides I follow for JavaScript and PHP are recommending this too, and I see Rust is looking forward to recommend this practice too.
So basically, I'm for the following (let's assume the example strings are long enough to require a multiline structure):
However, I would be okay with not having commas at all in a multiline list.
Opinions?