disallowYodaConditions

Requires the variable to be the left hand operator when doing a boolean comparison

Type: Array or Boolean

Values: Array of quoted operators or true to disallow yoda conditions for most possible comparison operators

Example

"disallowYodaConditions": [
    "==",
    "===",
    "!=",
    "!=="
]
Valid
if (a == 1) {
    return
}
Invalid
if (1 == a) {
    return
}
Rule source
Test source