by lalaithion · 3y ago · 0 comments
Although "real" production software would use feature flags of some kind instead of hardcoding the constant, sometimes you do just need to hide some code behind an if statement that is currently ineffectual, and linters that prevent that are extremely annoying and force me to write a confusing, convoluted expression that is too complicated for the linter to detect as constant true or constant false.
I don't think they are: binary expressions affected are expressions constructed with binary logical or comparison operator (==, ===, &&, ||, ??).
true and false each aren't binary expressions, they are simple constant values, and the lint isn't for constant conditionals.
(The rule for that is no-constant-condition.)
// takes editing tools in many situations
/* doesn't nest
Setting an if to false is easy and fast.