noAssignInExpressions
: please don't flag in arrow expressions
#4498
Replies: 3 comments 1 reply
-
Hi! Your suggestion applies to both arrow expressions and return statements? or only arrow expressions? In my view, the second code is cleaner and less confusing. Your problem seems more related to the formatting. |
Beta Was this translation helpful? Give feedback.
-
In the single line arrow expression, there is an implicit return. |
Beta Was this translation helpful? Give feedback.
-
Maybe one way to fix this could be to require |
Beta Was this translation helpful? Give feedback.
-
Environment information
What happened?
I would like to be able to write one-line functions that are basically "procedures", for example:
But this trips the lint rule
noAssignInExpressions
, so I have to rewrite it in 3 lines asI know this is whining, and I could always disable the rule, but does this have to be flagged?
Is
return (a=b)
really a problem?Waaaaah!
Expected result
return (a=b)
is OKCode of Conduct
Beta Was this translation helpful? Give feedback.
All reactions