I would like Stylistic to erase more of those useless lines that Prettier use to collapse, like :
// Valid with Stylistic
const val = [
'app',
'hello',
]
// Formatted with Prettier
const val = ['app', 'coucou']
The issue is not that Prettier made this one-line (because it simply has a sense of line-length, instead of the AST), but more that Prettier is able to collapse those completely empty lines.
The same is true for IfStatement for example, and I think many more statements.
Suggested solution
The idea is not just about erasing empty lines, because we need padding around when we code, but about erasing empty lines inside of declarations or statements where it has no value to have empty lines.
IfStatement
ForStatement
ArrayExpression
... and probably others
Alternative
It's not a big deal so I didn't look for an alternative way. It will be a "best practice" to handle manually for now 😄
Additional context
I was simply playing around with Stylistic and realized that I could make empty lines pop-up from anywhere, without auto-collapsing those while they are useless (until no-multiple-empty-lines catches me).
Clear and concise description of the problem
I would like Stylistic to erase more of those useless lines that Prettier use to collapse, like :
The issue is not that Prettier made this one-line (because it simply has a sense of line-length, instead of the AST), but more that Prettier is able to collapse those completely empty lines.
The same is true for IfStatement for example, and I think many more statements.
Suggested solution
The idea is not just about erasing empty lines, because we need padding around when we code, but about erasing empty lines inside of declarations or statements where it has no value to have empty lines.
Alternative
It's not a big deal so I didn't look for an alternative way. It will be a "best practice" to handle manually for now 😄
Additional context
I was simply playing around with Stylistic and realized that I could make empty lines pop-up from anywhere, without auto-collapsing those while they are useless (until
no-multiple-empty-lines
catches me).Validations
Contributes