[][src]Function rslint_core::util::simple_const_condition_context

pub fn simple_const_condition_context(
    parent: SyntaxNode,
    condition_value: bool,
    diagnostic: Diagnostic
) -> Diagnostic

Issue more context around the effects of a constant condition on a node.

For example, if the statement is an if statement and the condition value is false, that means the if statement cons is unreachable and the else statement always triggers. This function adds labels which illustrate that. You should get the condition_value from simple_bool_coerce. This method does nothing if the node is not a cond expr, if, while, do while, or for stmt