For some reason Prettier breaks the line with comments moving everything after opened braŃket on new line. Here is before
As you can see it makes kind of random formatting: at the 1st line it moves comments to a line above, then it breaks line by brackets, then again moves comments above. I found here How to prevent Prettier from moving comments to new line it’s like impossible to prevent Prettier from moving comments to a new line, but I can’t find something about how to prevent it from breaking lines and making that bunches of cascades. Increasing Print width (line limit) does nothing, it’s 160 for me now. Any solutions?
Advertisement
Answer
Prettier is for front-end. Use Python formatter instead, for example, Black formatter.