I have an annoying problem with the Prettier formatter. Whenever I type in an object, array or a JSX component, there's a line break that I can't find a way to disable.
For example, trying to type a long mongoose enum:
I want it to look like this:
genres: {
type: [String],
enum: [
'Pop', 'Rock', 'Disco', 'Jazz', 'Hip Hop', 'Folk', 'Blues',
'Metal', Country', 'Classical', 'RnB', 'Soul', Dance', Funk','Reggae'],
But Prettier always formats it like this:
genres: {
type: [String],
enum: [
'Pop',
'Rock',
'Disco',
'Jazz',
'Hip Hop',
'Folk',
'Blues',
'Metal',
'Country',
'Classical',
'RnB',
'Soul',
'Dance',
'Funk',
'Reggae',
],
JSX example: I want it to look like this:
<SomeElement prop1="bla" prop2="bla" prop3="bla"
prop4="bla" prop5="bla" prop6="bla" prop7="bla" />
But Prettier formats it like this:
<SomeElement
prop1="bla"
prop2="bla"
prop3="bla"
prop4="bla"
prop5="bla"
prop6="bla"
prop7="bla"
/>
Am I missing anything, or is this just not possible with Prettier? I tried changing the 'Print Width' option, but it didn't help much because whenever i pass the print width length it will break lines like this again.