You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: no_constant_condition.rs
    path of file: ./repos/rslint/crates/rslint_core/src/groups/errors
    
    the code of the file until where you have to start completion: use crate::rule_prelude::*;
use ast::*;
use SyntaxKind::*;

declare_lint! {
    /**
    Disallow constant conditions which always yield one result.

    Constant conditions such as `if (true) {}` are almost always a mistake. Constant
    conditions always yield a single result which almost always ends up in unwanted behavior.
    This rule is aimed at catching those conditions in `if`, `do while`, `while`, and `for` statements, as well as
    conditional expressions.

    ## Incorrect Code Examples

    ```js
    if (true) {
        //    ^ this block is always used
    } else {
    //^^^^ this else block is unreachable
    }
    ```

    ```js
    // This loop endlessly runs
    for(foo = 5; 5; foo++) {

    }
    ```

    ## Correct Code Examples

    ```js
    if (foo) {
        /* */
    }
    ```
    */
    #[derive(Default)
    
    fn check_node(&self, node: &SyntaxNode, ctx: &mut RuleCtx) -> Option<()> {
        let mut notes = vec![];
        let cond = match node.kind() {
            IF_STMT | DO_WHILE_STMT | WHILE_STMT => {
                if let Some(cond) = node.children().find_map(|node| node.try_to::<Condition>()) {
                    if !util::is_const(cond.condition()?, true, &mut notes) {
                        return None;
                    }
                    cond.condition().unwrap()
                } else {
                    return None;
                }
            }
            COND_EXPR => {
                let cond = node.to::<CondExpr>().test()?;
                if !util::is_const(cond.clone(), true, &mut notes) {
                    return None;
                }
                cond
            }
            FOR_STMT => {
                let cond = node.to::<ForStmt>().test()?.expr()?;
                if !util::is_const(cond.clone(), true, &mut notes) {
                    return None;
                }
                cond
            }
            _ => return None,
        };

        let mut err = ctx.err(self.name(), "unexpected constant condition");
        if let Some(condition_value) = util::simple_bool_coerce(cond.clone()) {
            err = util::simple_const_condition_context(node.clone(), condition_value, err);
        } else {
            err = err.primary(cond.syntax(), "this condition always yields one result")
        }
        ctx.add_err(err);

        None
    }