prettier: trailingComma setting is not respected in SCSS lists/maps.
Prettier 1.11.0 Playground link
--parser scss
--trailing-comma all
Input:
$my-colors: (
'red',
'blue',
);
Output:
$my-colors: (
"red",
"blue"
);
Expected behavior:
This might be intentional, but is there a reason why the trailingComma
setting isn’t respected in other-than-JS languages (e.g. SCSS)?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 15 (14 by maintainers)
Commits related to this issue
- Allow trailing comma in scss list and maps * fix #4076 — committed to ad1992/prettier by ad1992 6 years ago
- Allow trailing comma in scss list and maps (#4317) * Allow trailing comma in scss list and maps * fix #4076 * triple equalto * newline * linting * review fixes * print trailing comm... — committed to prettier/prettier by ad1992 6 years ago
@jgerigmeyer sound reasonable
Let’s do it 👍
Labelling as a feature since the current output is valid SCSS.
Would be nice to add them and respect the setting if supported.
Sure, go ahead @ad1992!
@j-f1 can I take this up ?
The clearest SCSS styleguide I’m aware of that mentions trailing commas is Hugo Giraudel’s “Sass Guidelines”:
But regardless, I think trailing commas in multiline maps/lists is a common standard for most languages where there’s support, given the advantages for adding/removing/reordering items.
@suchipi let’s leave issue open to discission