(require|disallow)YodaConditions: add support for listing specific operators#1031
(require|disallow)YodaConditions: add support for listing specific operators#1031Slayer95 wants to merge 2 commits intojscs-dev:masterfrom
Conversation
|
looks good! |
3633159 to
3508bbf
Compare
3508bbf to
8c9c772
Compare
8c9c772 to
6425ebd
Compare
|
I thought about it. Look like we lost a reason of denying yoda conditions. Afaik it was a bad code style because there is a difference between |
|
I agree that yoda conditions are only useful to guard against that typo (i.e. Regarding Interestingly, ESLint provides the option to forbid Yoda Conditions except for ranges, which is my exact use case. |
There was a problem hiding this comment.
Why was this removed from the beforeEach?
|
@mrjoelkemp I think it's too complicated and can be simplified. I'm not sure that |
6425ebd to
ef4b343
Compare
|
Is that still WIP? |
|
Waiting for feedback / replies to @zxqfox with details regarding what we want as destination. I guess I should have used something like "WFF" rather than "WIP" -if that's a thing. |
|
ping @zxqfox |
There was a problem hiding this comment.
What if make ['==', '===', '!='] by default (true)?
There was a problem hiding this comment.
Even just '===' and '=='.
Historical reasons.
There was a problem hiding this comment.
I'm not sure about this. As to me they are all Yoda-style. And still I can't see enough reasons to break backwards compatibility.
There was a problem hiding this comment.
It wouldn't actually break anything though. That is, no failing builds on update.
There was a problem hiding this comment.
I'm not talking about the builds. I'm about the unexpected behaviour change. For instance, I know several projects which rely on the current behaviour.
There was a problem hiding this comment.
Actually I'm fine if we left it as is.
|
Sorry for delay, somehow missed this PR. ;-( |
ef4b343 to
dbfd67b
Compare
dbfd67b to
7034ae9
Compare
|
Updated tests as requested. |
|
@Slayer95 Thanks! LGTM |
|
LGTM! Good job! |
|
@markelog Yes, sure :) |
|
Merged into |
Fixes #1026