-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Break before operator on expression bodied methods and variable declarations. #205
Comments
Both look OK to me visually. Also, prettier uses the latter. Do you have a concrete case in mind where we can benefit from using the former? |
There are readability arguments for breaking before the operator If you run into this type of a statement, it seems a little weird to have the = and the + aligned. var someLongName
= "someReallyLongValueThatBreaks11111111111111111111111111111111"
+ "someOtherReallyLongValue"
+ "someOtherReallyLongValue"; which could probably be solved by indenting var someLongName
= "someReallyLongValueThatBreaks11111111111111111111111111111111"
+ "someOtherReallyLongValue"
+ "someOtherReallyLongValue"; I did have a chance to discuss this with coworkers today, and they liked the idea of breaking before = and => |
Don't have a super strong preference, but I'm curious how you'd handle expression bodied lambdas like: someLongAssObject.SomeLongAssFunction((someLongAssArg, someLongerAsserArg) => someLongAssArg.SomeLongAssMethod(someLongerAsserArg.SomeLongAssProperty)) |
@belav Interesting articles. There's one small catch though. In the links you gave, they are only talking about arithmetic and boolean operators, not assignment. Same goes for |
I think we should consider breaking before the operator for the following statements.
As compared to
The text was updated successfully, but these errors were encountered: