Skip to content

Commit

Permalink
update according to comment
Browse files Browse the repository at this point in the history
  • Loading branch information
baseballyama committed Dec 27, 2024
1 parent b6f15b8 commit 1450146
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/oxc_linter/src/rules/eslint/no_negated_condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ declare_oxc_lint!(
/// ```
NoNegatedCondition,
style,
pending,
);

impl Rule for NoNegatedCondition {
Expand All @@ -55,12 +56,12 @@ impl Rule for NoNegatedCondition {
}

if is_negated_if(if_stmt) {
ctx.diagnostic(no_negated_condition_diagnostic(node.span()));
ctx.diagnostic(no_negated_condition_diagnostic(if_stmt.span()));
}
}
AstKind::ConditionalExpression(conditional_expr) => {
if is_negated_if_conditional(conditional_expr) {
ctx.diagnostic(no_negated_condition_diagnostic(node.span()));
ctx.diagnostic(no_negated_condition_diagnostic(conditional_expr.span()));
}
}
_ => {}
Expand Down

0 comments on commit 1450146

Please sign in to comment.