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
Currently, we have rules for array-bracket-newline and object-curly-newline to ensure consistency in line breaks on open and closing brackets for creating arrays and objects.
We also have function-paren-newline which is something similar for functions and parenthesis, but that is limited to this scope. With that, it's possible to have codes like this that have no way to be consistent (as far as I have researched):
if(someLongLongVariable??other){return;}
Suggested solution
For the code above, I suggested we have paren-newline, which can apply to function paren and all other scopes (if statements, functions and other expressions, as examples below). For the if statement example, using paren-newline with consistent: true, I expect the following output:
if(someLongLongLongVariable??other){return;}
Similarly, here are some other pairs of inputs and expected outputs:
Clear and concise description of the problem
Currently, we have rules for
array-bracket-newline
andobject-curly-newline
to ensure consistency in line breaks on open and closing brackets for creating arrays and objects.We also have
function-paren-newline
which is something similar for functions and parenthesis, but that is limited to this scope. With that, it's possible to have codes like this that have no way to be consistent (as far as I have researched):Suggested solution
For the code above, I suggested we have
paren-newline
, which can apply to function paren and all other scopes (if statements, functions and other expressions, as examples below). For the if statement example, usingparen-newline
withconsistent: true
, I expect the following output:Similarly, here are some other pairs of inputs and expected outputs:
Alternative
No response
Additional context
No response
Validations
Contributes
The text was updated successfully, but these errors were encountered: