prettier: SCSS comments are broken in maps with values that include functions.
Prettier 1.13.5 Playground link
--parser scss
Input:
$my-map: (
'foo': 1, // Foo
'bar': 2, // Bar
'buz': calc(1 + 2), // Buz
'baz': 4, // Baz
);
Output:
$my-map: (
"foo": 1,
// Foo
"bar": 2,
// Bar
"buz": calc(1 + 2),
// Buz "baz": 4,
// Baz
);
Expected behavior: Ideally:
$my-map: (
"foo": 1, // Foo
"bar": 2, // Bar
"buz": calc(1 + 2), // Buz
"baz": 4, // Baz
);
But at the very least, this would be most similar to the existing functionality without causing errors:
$my-map: (
"foo": 1,
// Foo
"bar": 2,
// Bar
"buz": calc(1 + 2),
// Buz
"baz": 4,
// Baz
);
Other example:
$spacers: map-merge(
(
0: 0,
1: ($spacer * 0.25), // 4px
2: ($spacer * 0.5), // 8px
),
$spacers
);
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 7
- Comments: 18 (11 by maintainers)
Commits related to this issue
- Added a test to verify that #4659 is closed — committed to robert-j-webb/prettier by deleted user 4 years ago
- Added a test to verify that #4659 is closed (#7591) — committed to prettier/prettier by robert-j-webb 4 years ago
- remove scss comments prettier appears to have an open issue formatting comments in scss files: https://github.com/prettier/prettier/issues/4659 https://github.com/prettier/prettier/issues/5603 — committed to resolvetosavelives/benchmarks by sidk 4 years ago
as https://github.com/prettier/prettier/pull/7591 is merged, this can be closed.