This is currently considered a redundant-existence-check:
f(obj) if {
obj.type
obj.type == "object"
}
But this isn't:
f(obj) if {
obj.type == "object"
obj.type
}
Whether the intent was an existence check or not, the latter should also be considered a violation of this rule.
I actually found a case of this in our own code here 😅
This is currently considered a redundant-existence-check:
But this isn't:
Whether the intent was an existence check or not, the latter should also be considered a violation of this rule.
I actually found a case of this in our own code here 😅