Skip to content

Commit

Permalink
chore: 🤖 update
Browse files Browse the repository at this point in the history
  • Loading branch information
IWANABETHATGUY committed Sep 12, 2024
1 parent 2eecdfd commit a09d290
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions crates/oxc_linter/src/rules/eslint/no_plusplus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ use oxc_span::Span;
use crate::{context::LintContext, rule::Rule, AstNode};

fn no_plusplus_diagnostic(span: Span, operator: UpdateOperator) -> OxcDiagnostic {
let diagnostic =
OxcDiagnostic::warn(format!("Unary operator '{operator}' used.")).with_label(span);
let diagnostic = OxcDiagnostic::warn(format!(
"Unary operator '{operator}' used.",
operator = operator.as_str()
))
.with_label(span);

match operator {
UpdateOperator::Increment => {
return diagnostic.with_help("Use the assignment operator `+=` instead.");
diagnostic.with_help("Use the assignment operator `+=` instead.")
}
UpdateOperator::Decrement => {
return diagnostic.with_help("Use the assignment operator `-=` instead.");
diagnostic.with_help("Use the assignment operator `-=` instead.")
}
}

diagnostic
}

#[derive(Debug, Default, Clone)]
Expand Down

0 comments on commit a09d290

Please sign in to comment.