-
I'd like to create a group that breaks if any children contain
but instead what I see is: const { doc } = require('prettier')
const { group, line, indent, join, ifBreak, hardline, breakParent } =
doc.builders;
const sep = ifBreak(hardline, [',', line])
const entries = ['a', 'b', 'c']
entries.push(['d', breakParent])
const x = group([
'{',
indent([
line,
join(sep, entries)
]),
line,
'}'
])
console.log(
doc.printer.printDocToString(x, {
printWidth: 200,
tabWidth: 2,
useTabs: false,
}).formatted
);
`` |
Beta Was this translation helpful? Give feedback.
Answered by
fisker
Apr 16, 2023
Replies: 1 comment 1 reply
-
I think this may be fixed by https://github.com/prettier/prettier/pull/14466/files - does that sound right @fisker? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, possible. We should add test for it.