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
Although the scope functions are a way of making the code more concise, avoid overusing them: it can decrease your code readability and lead to errors. Avoid nesting scope functions and be careful when chaining them: it's easy to get confused about the current context object and the value of this or it.
The text was updated successfully, but these errors were encountered:
I like it but this will be very controversial and hard to turn on in any code base.
Maybe We should already think about config parameters such as depth of nesting and allowing functions references.
It should not be that controversial. The official documentation say that.
And about adopting the rule, I don't think it should be hard. You enable it, you recreate the baseline and you are good to go. Any new nesting scope function will be reported. How to handle the ones in the baseline is another thing.
I would vote to launch the rule without any nesting paramater. If there are complains and good reasons to add it we can add it later. But, right now, I can't think a good reason to allow 2 nesting scope functions and forbid 3.
Expected Behavior of the rule
non-compilant:
A rule to forbid nesting scope functions.
Context
Extracted from Kotlin Scope functions (emphasis mine):
The text was updated successfully, but these errors were encountered: