Prettier: Why Prettier recommend against using more than 80 columns?

Created on 1 Jul 2017  ·  3Comments  ·  Source: prettier/prettier

Would like to know How this decision was taken and why?

locked-due-to-inactivity

Most helpful comment

Prettier will always put as much code as it can into a line. Normally when you have a line length of 120 in a style guide you mean that this is the maximum length and you will usually keep the line length at around 80 chars anyway. Prettier, on the other hand, will put as much code as it can in one line so every line will be at around 110 - 120 characters. This is harder to read than around 80 characters.

All 3 comments

Prettier works by cramming as much content as possible until it reaches the limit, which happens to work well for 80 columns but makes lines that are very crowded. When a bigger column count is used in styleguides, it usually means that code is allowed to go beyond 80 columns, but not to make every single line go there, like Prettier would do.

Maybe I'm not as intelligent to understand that part of the readme. Could you please try to rephrase it?

Prettier will always put as much code as it can into a line. Normally when you have a line length of 120 in a style guide you mean that this is the maximum length and you will usually keep the line length at around 80 chars anyway. Prettier, on the other hand, will put as much code as it can in one line so every line will be at around 110 - 120 characters. This is harder to read than around 80 characters.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brigand picture brigand  ·  3Comments

MarkKahn picture MarkKahn  ·  3Comments

n1k0 picture n1k0  ·  3Comments

poteto picture poteto  ·  3Comments

grgur picture grgur  ·  3Comments