I have written a single line of code.
And after save prettier reformat the line into 2.
How to stop prettier from breaking lines into two?
I have written a single line of code.
And after save prettier reformat the line into 2.
How to stop prettier from breaking lines into two?
You need to increase the printWidth
in your .prettierrc
file:
The number is the number of characters before a wrap will be attempted, to stop lines from being wrapped at all set a high number like 1000
.
.prettierrc
{
"printWidth": 1000
}
From the prettier documentation
Print Width:
Specify the line length that the printer will wrap on.