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
I doubt it's that useful if the closure contains a comparison, as this way the only thing you add is a Not::not(_), thus making the code slightly longer. However, if the closure has a !p(e), linting would actually make sense.
I would argue that !...any(..) and !...all(..) are less intuitive, therefore more complex than ...all(!..) and ...any(!..), but you say, only !...any(!..) would trigger you? Maybe this needs a configuration parameter, or maybe these are 2 rules, one pedantic and one complexity?
I was looking around lints and could not find a similar rule for turning !.. && !.. into !(.. || ..) and its dual. If there was such a rule, it would also be useful for everyone for expressions like !(!.. && !..) and !(!.. || !..).
What it does
Would be good to suggest:
to
(and the opposite)
This didn't seem to be in the complexity group, but similar others were so I think this is missing.
Lint Name
De Morgan any / all
Category
complexity
Advantage
simpler
Drawbacks
none
Example
Could be written as:
The text was updated successfully, but these errors were encountered: