-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use exceptRange
for Yoda rule
#1
Conversation
Llewellyn Falco makes an excellent argument for why to write things like `0 < x`. Alternatively, since the default setting is "never", you could consider this a stylistic rule, and argue that it should not be in this config at all. (Since only when setting it to "always" is it preventing problems, but also those problems are already prevented by the `no-cond-assign` rule.)
Will have a look later today |
Cool, thanks! Actually, I just noticed that |
I personally strongly disagree with Llewellyn Falco here; he thinks in terms of a number line, I think in terms of reading the code. To me, I think we all agree The |
Yeah, that all makes sense to me. I think it's best then to just disable the rule altogether, because even though |
True, true; I see your point, but we also disallow this: if (foo) return something()
else return somethingElse() ^ That isn't strictly a problem, but it's dumb and verbose. How about |
Very true, so I guess it's up to you if you want to include "dumb and verbose" in the scope of this plugin. 😉 If that's what you want, then |
Loosened with |
Llewellyn Falco makes an excellent argument for why to write things like
0 < x
.Alternatively, since the default setting is "never", you could consider this a stylistic
rule, and argue that it should not be in this config at all. (Since only when setting it
to "always" is it preventing problems, but also those problems are already prevented
by the
no-cond-assign
rule.)