You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common practice in code style is to have 3 possibilities regarding blank lines between statements and blocks: no blank line at all, 1 blank line, or 2 blank lines.
It is common to group statements that are closely related, or to separate function blocks by a single blank line for readability.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
A common practice in code style is to have 3 possibilities regarding blank lines between statements and blocks: no blank line at all, 1 blank line, or 2 blank lines.
It is common to group statements that are closely related, or to separate function blocks by a single blank line for readability.
In the Python world, PEP8 recommends to "surround top-level function and class definitions with two blank lines" (see https://peps.python.org/pep-0008/#blank-lines).
In my opinion these 2 blank lines greatly improve code readability.
Yet Prettier only allows zero or 1 blank line, but not 2.
Is this point open to discussion? Can Prettier's opinion evolve on that matter?
I have implemented it naively but would need approval and maybe advice on how to do it "well".
PS: I know that:
Beta Was this translation helpful? Give feedback.
All reactions