They are not interchangeable. Maybe some advice in the short info and the Rule Description would be helpful.
“This rule reports when disjunctions (||) and conditionals (?) can be safely replaced with coalescing (??).”
This is not the case.
Example TypeScript:
Because x can be a bool false the operators can not be safely replaced.
const x: null | undefined | boolean | string;
const y = x || '';
In this case a safe replacement is possible
const x: null | undefined | string;
const y = x || '';
In TypeScript the rule can be fitted to just take effect in cases where false is not possible, I don’t see that in JavaScript, maybe this should be a TS-only rule an be deactivated for JS.
Hi, I think in typing, you mixed up the return values for this part of your post.
It should be the below instead.
It would be nice if you modify it so as to minimize confusion for others. Thanks.