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
{{ message }}
Repository navigation
What is Prettier's take on padding-line-between-statements? #13063
Is there any Prettier opinionated enforced rule for separating statements with blank lines?
I have been using this huge ESLint padding-line-between-statements config and would like to replace it with prettier's standards, but it seems to be a lot more flexible about padding lines...
"padding-line-between-statements": [
"error",
// After directives (like 'use-strict'), except between directives
{ "blankLine": "always", "prev": "directive", "next": "*" },
{ "blankLine": "any", "prev": "directive", "next": "directive" },
// After imports, except between imports
{ "blankLine": "always", "prev": "import", "next": "*" },
{ "blankLine": "any", "prev": "import", "next": "import" },
// Before and after every sequence of variable declarations
{ "blankLine": "always", "prev": "*", "next": ["const", "let", "var"] },
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"] },
// Before and after class declaration, if, while, switch, try
{ "blankLine": "always", "prev": "*", "next": ["class", "if", "while", "switch", "try"] },
{ "blankLine": "always", "prev": ["class", "if", "while", "switch", "try"], "next": "*" },
// Before return statements
{ "blankLine": "always", "prev": "*", "next": "return" }
],
Activity
alexander-akait commentedon Jul 2, 2022
Prettier doesn't have options for this, please read https://prettier.io/docs/en/rationale.html#empty-lines