diff --git a/crates/oxc_linter/src/rules/eslint/func_names.rs b/crates/oxc_linter/src/rules/eslint/func_names.rs index 5cf5f5d75b1974..3bee0d0f5cac33 100644 --- a/crates/oxc_linter/src/rules/eslint/func_names.rs +++ b/crates/oxc_linter/src/rules/eslint/func_names.rs @@ -450,8 +450,7 @@ impl Rule for FuncNames { |name| { // if this name shadows a variable in the outer scope **and** that name is referenced // inside the function body, it is unsafe to add a name to this function - if ctx.scopes().find_binding(func.scope_id(), &name).map_or( - false, + if ctx.scopes().find_binding(func.scope_id(), &name).is_some_and( |shadowed_var| { ctx.semantic().symbol_references(shadowed_var).any( |reference| { diff --git a/crates/oxc_linter/src/rules/jsx_a11y/no_aria_hidden_on_focusable.rs b/crates/oxc_linter/src/rules/jsx_a11y/no_aria_hidden_on_focusable.rs index 672e5095044059..16e4b2d5a9cb62 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/no_aria_hidden_on_focusable.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/no_aria_hidden_on_focusable.rs @@ -97,7 +97,7 @@ fn is_focusable<'a>(ctx: &LintContext<'a>, element: &JSXOpeningElement<'a>) -> b if let Some(JSXAttributeItem::Attribute(attr)) = has_jsx_prop_ignore_case(element, "tabIndex") { if let Some(attr_value) = &attr.value { - return parse_jsx_value(attr_value).map_or(false, |num| num >= 0.0); + return parse_jsx_value(attr_value).is_ok_and(|num| num >= 0.0); } } diff --git a/crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs b/crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs index 2f538293050347..622343f56a67f2 100644 --- a/crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs +++ b/crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs @@ -152,14 +152,12 @@ impl Rule for JsxNoTargetBlank { } } else if attribute_name == "href" || attribute_name == "action" - || ctx.settings().react.get_link_component_attrs(tag_name).map_or( - false, + || ctx.settings().react.get_link_component_attrs(tag_name).is_some_and( |link_attribute| { link_attribute.contains(&CompactStr::new(attribute_name)) }, ) - || ctx.settings().react.get_form_component_attrs(tag_name).map_or( - false, + || ctx.settings().react.get_form_component_attrs(tag_name).is_some_and( |form_attribute| { form_attribute.contains(&CompactStr::new(attribute_name)) }, diff --git a/tasks/rulegen/src/main.rs b/tasks/rulegen/src/main.rs index beb86e180546dc..c819ed24218ea2 100644 --- a/tasks/rulegen/src/main.rs +++ b/tasks/rulegen/src/main.rs @@ -143,7 +143,7 @@ impl TestCase { ); // ("null==null", "null === null", None), - Some(format!(r#"({code}, {output}, {config})"#)) + Some(format!(r"({code}, {output}, {config})")) } }