diff --git a/crates/oxc_diagnostics/src/lib.rs b/crates/oxc_diagnostics/src/lib.rs index 1f700511ae46d..752af553684d1 100644 --- a/crates/oxc_diagnostics/src/lib.rs +++ b/crates/oxc_diagnostics/src/lib.rs @@ -87,7 +87,7 @@ impl OxcDiagnostic { } #[must_use] - pub fn warning>(message: T) -> Self { + pub fn warn>(message: T) -> Self { Self { inner: Box::new(OxcDiagnosticInner { message: message.into(), diff --git a/crates/oxc_diagnostics/src/service.rs b/crates/oxc_diagnostics/src/service.rs index bcc5287d28e4b..6cef88a91240b 100644 --- a/crates/oxc_diagnostics/src/service.rs +++ b/crates/oxc_diagnostics/src/service.rs @@ -139,7 +139,7 @@ impl DiagnosticService { // Skip large output and print only once if err_str.lines().any(|line| line.len() >= 400) { let minified_diagnostic = Error::new( - OxcDiagnostic::warning("File is too long to fit on the screen") + OxcDiagnostic::warn("File is too long to fit on the screen") .with_help(format!("{path:?} seems like a minified file")), ); err_str = format!("{minified_diagnostic:?}"); diff --git a/crates/oxc_linter/src/fixer.rs b/crates/oxc_linter/src/fixer.rs index 2151f8f8e8d0c..becf8f8524d5b 100644 --- a/crates/oxc_linter/src/fixer.rs +++ b/crates/oxc_linter/src/fixer.rs @@ -127,55 +127,55 @@ mod test { use super::{Fix, FixResult, Fixer, Message}; fn insert_at_end() -> OxcDiagnostic { - OxcDiagnostic::warning("End") + OxcDiagnostic::warn("End") } fn insert_at_start() -> OxcDiagnostic { - OxcDiagnostic::warning("Start") + OxcDiagnostic::warn("Start") } fn insert_at_middle() -> OxcDiagnostic { - OxcDiagnostic::warning("Multiply") + OxcDiagnostic::warn("Multiply") } fn replace_id() -> OxcDiagnostic { - OxcDiagnostic::warning("foo") + OxcDiagnostic::warn("foo") } fn replace_var() -> OxcDiagnostic { - OxcDiagnostic::warning("let") + OxcDiagnostic::warn("let") } fn replace_num() -> OxcDiagnostic { - OxcDiagnostic::warning("5") + OxcDiagnostic::warn("5") } fn remove_start() -> OxcDiagnostic { - OxcDiagnostic::warning("removestart") + OxcDiagnostic::warn("removestart") } fn remove_middle(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("removemiddle").with_labels([span0.into()]) + OxcDiagnostic::warn("removemiddle").with_labels([span0.into()]) } fn remove_end() -> OxcDiagnostic { - OxcDiagnostic::warning("removeend") + OxcDiagnostic::warn("removeend") } fn reverse_range() -> OxcDiagnostic { - OxcDiagnostic::warning("reversed range") + OxcDiagnostic::warn("reversed range") } fn no_fix(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("nofix").with_labels([span0.into()]) + OxcDiagnostic::warn("nofix").with_labels([span0.into()]) } fn no_fix_1(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("nofix1").with_labels([span0.into()]) + OxcDiagnostic::warn("nofix1").with_labels([span0.into()]) } fn no_fix_2(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("nofix2").with_labels([span0.into()]) + OxcDiagnostic::warn("nofix2").with_labels([span0.into()]) } const TEST_CODE: &str = "var answer = 6 * 7;"; diff --git a/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs b/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs index fd80338283d60..2e38bd688ed94 100644 --- a/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs +++ b/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs @@ -18,7 +18,7 @@ use crate::{ }; fn expect_return(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(array-callback-return): Missing return on some path for array method {x0:?}" )) .with_help(format!("Array method {x0:?} needs to have valid return on all code paths")) @@ -26,7 +26,7 @@ fn expect_return(x0: &str, span1: Span) -> OxcDiagnostic { } fn expect_no_return(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(array-callback-return): Unexpected return for array method {x0:?}" )) .with_help(format!("Array method {x0:?} expects no useless return from the function")) diff --git a/crates/oxc_linter/src/rules/eslint/default_case_last.rs b/crates/oxc_linter/src/rules/eslint/default_case_last.rs index 187c607e6ad5e..140ea36a8dea8 100644 --- a/crates/oxc_linter/src/rules/eslint/default_case_last.rs +++ b/crates/oxc_linter/src/rules/eslint/default_case_last.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn default_case_last_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(default-case-last): Enforce default clauses in switch statements to be last", ) .with_labels([LabeledSpan::new_with_span( diff --git a/crates/oxc_linter/src/rules/eslint/default_param_last.rs b/crates/oxc_linter/src/rules/eslint/default_param_last.rs index 8567ad62a7ccf..ab84a6f01ab29 100644 --- a/crates/oxc_linter/src/rules/eslint/default_param_last.rs +++ b/crates/oxc_linter/src/rules/eslint/default_param_last.rs @@ -8,7 +8,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn default_param_last_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(default-param-last): Default parameters should be last") + OxcDiagnostic::warn("eslint(default-param-last): Default parameters should be last") .with_help("Enforce default parameters to be last.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/eqeqeq.rs b/crates/oxc_linter/src/rules/eslint/eqeqeq.rs index 524f6491a5198..01898d38df913 100644 --- a/crates/oxc_linter/src/rules/eslint/eqeqeq.rs +++ b/crates/oxc_linter/src/rules/eslint/eqeqeq.rs @@ -11,7 +11,7 @@ use oxc_syntax::operator::{BinaryOperator, UnaryOperator}; use crate::{context::LintContext, fixer::Fix, rule::Rule, AstNode}; fn eqeqeq_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint(eqeqeq): Expected {x1} and instead saw {x0}")) + OxcDiagnostic::warn(format!("eslint(eqeqeq): Expected {x1} and instead saw {x0}")) .with_help(format!("Prefer {x1} operator")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/for_direction.rs b/crates/oxc_linter/src/rules/eslint/for_direction.rs index cd16d51390ebb..3e33447dde511 100644 --- a/crates/oxc_linter/src/rules/eslint/for_direction.rs +++ b/crates/oxc_linter/src/rules/eslint/for_direction.rs @@ -14,7 +14,7 @@ use oxc_syntax::operator::{AssignmentOperator, BinaryOperator, UnaryOperator, Up use crate::{context::LintContext, rule::Rule, AstNode}; fn for_direction_diagnostic(span0: Span, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(for-direction): The update clause in this loop moves the variable in the wrong direction") + OxcDiagnostic::warn("eslint(for-direction): The update clause in this loop moves the variable in the wrong direction") .with_help("Use while loop for intended infinite loop") .with_labels([LabeledSpan::new_with_span(Some("This test moves in the wrong direction".into()), span0), LabeledSpan::new_with_span(Some("with this update".into()), span1)]) } diff --git a/crates/oxc_linter/src/rules/eslint/getter_return.rs b/crates/oxc_linter/src/rules/eslint/getter_return.rs index 3d8f7b955f0bb..46058a66cb20c 100644 --- a/crates/oxc_linter/src/rules/eslint/getter_return.rs +++ b/crates/oxc_linter/src/rules/eslint/getter_return.rs @@ -16,7 +16,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn getter_return_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(getter-return): Expected to always return a value in getter.") + OxcDiagnostic::warn("eslint(getter-return): Expected to always return a value in getter.") .with_help("Return a value from all code paths in getter.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/guard_for_in.rs b/crates/oxc_linter/src/rules/eslint/guard_for_in.rs index 82fb435a3cf59..9d1b8a78d808d 100644 --- a/crates/oxc_linter/src/rules/eslint/guard_for_in.rs +++ b/crates/oxc_linter/src/rules/eslint/guard_for_in.rs @@ -8,7 +8,7 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; fn guard_for_in_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(guard-for-in): Require `for-in` loops to include an `if` statement") + OxcDiagnostic::warn("eslint(guard-for-in): Require `for-in` loops to include an `if` statement") .with_help("The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs b/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs index 226b8889b8785..edd6198d1f0ed 100644 --- a/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs +++ b/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs @@ -10,7 +10,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn max_classes_per_file_diagnostic(total: usize, max: usize, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(max-classes-per-file): File has too many classes ({total}). Maximum allowed is {max}", )) .with_help("Reduce the number of classes in this file") diff --git a/crates/oxc_linter/src/rules/eslint/max_lines.rs b/crates/oxc_linter/src/rules/eslint/max_lines.rs index 6aec92d03cbf1..0bc5fa32c9160 100644 --- a/crates/oxc_linter/src/rules/eslint/max_lines.rs +++ b/crates/oxc_linter/src/rules/eslint/max_lines.rs @@ -8,7 +8,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn max_lines_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint(max-lines): {x0:?}")) + OxcDiagnostic::warn(format!("eslint(max-lines): {x0:?}")) .with_help("Reduce the number of lines in this file") .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/max_params.rs b/crates/oxc_linter/src/rules/eslint/max_params.rs index 4bda36d5ac061..d1de0f4a1c6f6 100644 --- a/crates/oxc_linter/src/rules/eslint/max_params.rs +++ b/crates/oxc_linter/src/rules/eslint/max_params.rs @@ -8,7 +8,7 @@ use serde_json::Value; use crate::{context::LintContext, rule::Rule, AstNode}; fn max_params_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint(max-params): {x0:?}")) + OxcDiagnostic::warn(format!("eslint(max-params): {x0:?}")) .with_help( "This rule enforces a maximum number of parameters allowed in function definitions.", ) diff --git a/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs b/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs index 62f87fa3d90e0..096905d8e6bd8 100644 --- a/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_array_constructor_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-array-constructor): Disallow `Array` constructors") + OxcDiagnostic::warn("eslint(no-array-constructor): Disallow `Array` constructors") .with_help("Use array literal instead") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs b/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs index 1234f8e086a22..d9c6effb31253 100644 --- a/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs @@ -10,7 +10,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_async_promise_executor_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-async-promise-executor): Promise executor functions should not be `async`.", ) .with_labels([span0.into()]) diff --git a/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs b/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs index b51c49527169a..34571d11ffd47 100644 --- a/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs +++ b/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs @@ -10,7 +10,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_await_in_loop_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-await-in-loop): Unexpected `await` inside a loop.") + OxcDiagnostic::warn("eslint(no-await-in-loop): Unexpected `await` inside a loop.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_bitwise.rs b/crates/oxc_linter/src/rules/eslint/no_bitwise.rs index 198c695b51130..a1211898d3f09 100644 --- a/crates/oxc_linter/src/rules/eslint/no_bitwise.rs +++ b/crates/oxc_linter/src/rules/eslint/no_bitwise.rs @@ -8,7 +8,7 @@ use oxc_syntax::operator::BinaryOperator; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_bitwise_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint(no-bitwise): Unexpected use of {x0:?}")) + OxcDiagnostic::warn(format!("eslint(no-bitwise): Unexpected use of {x0:?}")) .with_help("bitwise operators are not allowed, maybe you mistyped `&&` or `||`") .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_caller.rs b/crates/oxc_linter/src/rules/eslint/no_caller.rs index b59a8001c8cc2..c19959b3ef2c6 100644 --- a/crates/oxc_linter/src/rules/eslint/no_caller.rs +++ b/crates/oxc_linter/src/rules/eslint/no_caller.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_caller_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-caller): Disallow the use of arguments.caller or arguments.callee") + OxcDiagnostic::warn("eslint(no-caller): Disallow the use of arguments.caller or arguments.callee") .with_help("'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs b/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs index 6fbe2ba3fd8b8..160e705a53aa4 100644 --- a/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs +++ b/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs @@ -10,7 +10,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_case_declarations_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-case-declarations): Unexpected lexical declaration in case block.", ) .with_labels([span0.into()]) diff --git a/crates/oxc_linter/src/rules/eslint/no_class_assign.rs b/crates/oxc_linter/src/rules/eslint/no_class_assign.rs index 89d22c1eff81a..711348499b65c 100644 --- a/crates/oxc_linter/src/rules/eslint/no_class_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_class_assign.rs @@ -7,13 +7,11 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_class_assign_diagnostic(x0: &str, span1: Span, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( - "eslint(no-class-assign): Unexpected re-assignment of class {x0}" - )) - .with_labels([ - LabeledSpan::new_with_span(Some(format!("{x0} is declared as class here")), span1), - LabeledSpan::new_with_span(Some(format!("{x0} is re-assigned here")), span2), - ]) + OxcDiagnostic::warn(format!("eslint(no-class-assign): Unexpected re-assignment of class {x0}")) + .with_labels([ + LabeledSpan::new_with_span(Some(format!("{x0} is declared as class here")), span1), + LabeledSpan::new_with_span(Some(format!("{x0} is re-assigned here")), span2), + ]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs b/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs index ea0d75bba8fcd..af79066148f64 100644 --- a/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs +++ b/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs @@ -8,7 +8,7 @@ use oxc_syntax::operator::{BinaryOperator, UnaryOperator}; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_compare_neg_zero_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(no-compare-neg-zero): Do not use the {x0} operator to compare against -0." )) .with_help("Use Object.is(x, -0) to test equality with -0 and use 0 for other cases") diff --git a/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs b/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs index fa22e7d7dc63f..72f3f49030718 100644 --- a/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs @@ -10,7 +10,7 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_cond_assign_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-cond-assign): Expected a conditional expression and instead saw an assignment", ) .with_help("Consider wrapping the assignment in additional parentheses") diff --git a/crates/oxc_linter/src/rules/eslint/no_console.rs b/crates/oxc_linter/src/rules/eslint/no_console.rs index 409caaaea9566..2223594873854 100644 --- a/crates/oxc_linter/src/rules/eslint/no_console.rs +++ b/crates/oxc_linter/src/rules/eslint/no_console.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_console_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-console): Unexpected console statement.") + OxcDiagnostic::warn("eslint(no-console): Unexpected console statement.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_const_assign.rs b/crates/oxc_linter/src/rules/eslint/no_const_assign.rs index a18ef557d382b..f533d9edb7c48 100644 --- a/crates/oxc_linter/src/rules/eslint/no_const_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_const_assign.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_const_assign_diagnostic(x0: &str, span1: Span, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(no-const-assign): Unexpected re-assignment of const variable {x0}" )) .with_labels([ diff --git a/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs b/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs index f01d39909e4f6..c4b519d2f0fcf 100644 --- a/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs +++ b/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs @@ -50,13 +50,13 @@ declare_oxc_lint!( ); fn constant_short_circuit(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint(no-constant-binary-expression): Unexpected constant {x0:?} on the left-hand side of a {x1:?} expression")) + OxcDiagnostic::warn(format!("eslint(no-constant-binary-expression): Unexpected constant {x0:?} on the left-hand side of a {x1:?} expression")) .with_help("This expression always evaluates to the constant on the left-hand side") .with_labels([span2.into()]) } fn constant_binary_operand(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-constant-binary-expression): Unexpected constant binary expression", ) .with_help(format!("This compares constantly with the {x0}-hand side of the {x1}")) @@ -64,7 +64,7 @@ fn constant_binary_operand(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { } fn constant_always_new(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-constant-binary-expression): Unexpected comparison to newly constructed object", ) .with_help("These two values can never be equal") @@ -72,7 +72,7 @@ fn constant_always_new(span0: Span) -> OxcDiagnostic { } fn constant_both_always_new(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-constant-binary-expression): Unexpected comparison of two newly constructed objects").with_help("These two values can never be equal").with_labels([span0.into()]) + OxcDiagnostic::warn("eslint(no-constant-binary-expression): Unexpected comparison of two newly constructed objects").with_help("These two values can never be equal").with_labels([span0.into()]) } impl Rule for NoConstantBinaryExpression { diff --git a/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs b/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs index dc2a3a7538b72..fccc90d91442e 100644 --- a/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs +++ b/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs @@ -7,7 +7,7 @@ use oxc_span::{GetSpan, Span}; use crate::{ast_util::IsConstant, context::LintContext, rule::Rule, AstNode}; fn no_constant_condition_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-constant-condition): Unexpected constant condition") + OxcDiagnostic::warn("eslint(no-constant-condition): Unexpected constant condition") .with_help("Constant expression as a test condition is not allowed") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_continue.rs b/crates/oxc_linter/src/rules/eslint/no_continue.rs index 00aafdc1639a5..04de2820b61c6 100644 --- a/crates/oxc_linter/src/rules/eslint/no_continue.rs +++ b/crates/oxc_linter/src/rules/eslint/no_continue.rs @@ -6,7 +6,7 @@ use oxc_macros::declare_oxc_lint; use oxc_span::Span; fn no_continue_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-continue): Unexpected use of `continue` statement.") + OxcDiagnostic::warn("eslint(no-continue): Unexpected use of `continue` statement.") .with_help("Do not use the `continue` statement.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_control_regex.rs b/crates/oxc_linter/src/rules/eslint/no_control_regex.rs index cd5a259f1269c..d0132edc515cf 100644 --- a/crates/oxc_linter/src/rules/eslint/no_control_regex.rs +++ b/crates/oxc_linter/src/rules/eslint/no_control_regex.rs @@ -12,7 +12,7 @@ use regex::{Matches, Regex}; use crate::{ast_util::extract_regex_flags, context::LintContext, rule::Rule, AstNode}; fn no_control_regex_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-control-regex): Unexpected control character(s)") + OxcDiagnostic::warn("eslint(no-control-regex): Unexpected control character(s)") .with_help(format!("Unexpected control character(s) in regular expression: \"{x0}\"")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_debugger.rs b/crates/oxc_linter/src/rules/eslint/no_debugger.rs index a9e2dc435b9f1..9c9e3bfc1c8f8 100644 --- a/crates/oxc_linter/src/rules/eslint/no_debugger.rs +++ b/crates/oxc_linter/src/rules/eslint/no_debugger.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, fixer::Fix, rule::Rule, AstNode}; fn no_debugger_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-debugger): `debugger` statement is not allowed") + OxcDiagnostic::warn("eslint(no-debugger): `debugger` statement is not allowed") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_delete_var.rs b/crates/oxc_linter/src/rules/eslint/no_delete_var.rs index b63198e42d2bd..98e82ab6899c4 100644 --- a/crates/oxc_linter/src/rules/eslint/no_delete_var.rs +++ b/crates/oxc_linter/src/rules/eslint/no_delete_var.rs @@ -8,7 +8,7 @@ use oxc_syntax::operator::UnaryOperator; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_delete_var_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-delete-var): variables should not be deleted") + OxcDiagnostic::warn("eslint(no-delete-var): variables should not be deleted") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_dupe_class_members.rs b/crates/oxc_linter/src/rules/eslint/no_dupe_class_members.rs index fa9831094cad4..4c283e85ef145 100644 --- a/crates/oxc_linter/src/rules/eslint/no_dupe_class_members.rs +++ b/crates/oxc_linter/src/rules/eslint/no_dupe_class_members.rs @@ -11,7 +11,7 @@ fn no_dupe_class_members_diagnostic( span1: Span, span2: Span, ) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint(no-dupe-class-members): Duplicate class member: {x0:?}")) + OxcDiagnostic::warn(format!("eslint(no-dupe-class-members): Duplicate class member: {x0:?}")) .with_help("The last declaration overwrites previous ones, remove one of them or rename if both should be retained") .with_labels([LabeledSpan::new_with_span(Some(format!("{x0:?} is previously declared here")), span1), LabeledSpan::new_with_span(Some(format!("{x0:?} is re-declared here")), span2)]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_dupe_else_if.rs b/crates/oxc_linter/src/rules/eslint/no_dupe_else_if.rs index 502b0269d34f0..ab2e094049c10 100644 --- a/crates/oxc_linter/src/rules/eslint/no_dupe_else_if.rs +++ b/crates/oxc_linter/src/rules/eslint/no_dupe_else_if.rs @@ -11,7 +11,7 @@ use oxc_syntax::operator::LogicalOperator; use crate::{ast_util::calculate_hash, context::LintContext, rule::Rule, AstNode}; fn no_dupe_else_if_diagnostic(span0: Span, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-dupe-else-if): duplicate conditions in if-else-if chains") + OxcDiagnostic::warn("eslint(no-dupe-else-if): duplicate conditions in if-else-if chains") .with_help("This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain") .with_labels([span0.into(), span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_dupe_keys.rs b/crates/oxc_linter/src/rules/eslint/no_dupe_keys.rs index 134ee77ebeb1f..e14e0ecbd2258 100644 --- a/crates/oxc_linter/src/rules/eslint/no_dupe_keys.rs +++ b/crates/oxc_linter/src/rules/eslint/no_dupe_keys.rs @@ -11,7 +11,7 @@ use rustc_hash::FxHashMap; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_dupe_keys_diagnostic(span0: Span, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-dupe-keys): Disallow duplicate keys in object literals") + OxcDiagnostic::warn("eslint(no-dupe-keys): Disallow duplicate keys in object literals") .with_help("Consider removing the duplicated key") .with_labels([span0.into(), span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs b/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs index 23b2006ff65a3..5d1a1076b8f14 100644 --- a/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs +++ b/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs @@ -8,7 +8,7 @@ use rustc_hash::FxHashMap; use crate::{ast_util::calculate_hash, context::LintContext, rule::Rule, AstNode}; fn no_duplicate_case_diagnostic(span0: Span, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-duplicate-case): Disallow duplicate case labels") + OxcDiagnostic::warn("eslint(no-duplicate-case): Disallow duplicate case labels") .with_help("Remove the duplicated case") .with_labels([span0.into(), span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty.rs b/crates/oxc_linter/src/rules/eslint/no_empty.rs index f2be977356922..9f531b0f158db 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_empty_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-empty): Disallow empty block statements") + OxcDiagnostic::warn("eslint(no-empty): Disallow empty block statements") .with_help(format!("Add comment inside empty {x0} statement")) .with_labels([LabeledSpan::new_with_span(Some(format!("Empty {x0} statement")), span1)]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs b/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs index c2a3d6a637777..0e0a9f0be9a7f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs @@ -10,7 +10,7 @@ use regex::Regex; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_empty_character_class_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-empty-character-class): Empty character class") + OxcDiagnostic::warn("eslint(no-empty-character-class): Empty character class") .with_help("Try to remove empty character class `[]` in regexp literal") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_function.rs b/crates/oxc_linter/src/rules/eslint/no_empty_function.rs index a6209a5b6c26b..c68c7141d07ca 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_function.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_function.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_empty_function_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-empty-function): Disallow empty functions") + OxcDiagnostic::warn("eslint(no-empty-function): Disallow empty functions") .with_help("Unexpected empty function block") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_pattern.rs b/crates/oxc_linter/src/rules/eslint/no_empty_pattern.rs index b0a61bb4e91f2..b947b6a8f2d26 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_pattern.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_pattern.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_empty_pattern_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-empty-pattern): Disallow empty destructuring patterns.") + OxcDiagnostic::warn("eslint(no-empty-pattern): Disallow empty destructuring patterns.") .with_help("Passing `null` or `undefined` will result in runtime error because `null` and `undefined` cannot be destructured.") .with_labels([LabeledSpan::new_with_span(Some(format!("Empty {x0} binding pattern")), span1)]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs b/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs index 1a5530518d979..65e29829a227f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_empty_static_block_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-empty-static-block): Disallow empty static blocks") + OxcDiagnostic::warn("eslint(no-empty-static-block): Disallow empty static blocks") .with_help("Unexpected empty static block.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_eq_null.rs b/crates/oxc_linter/src/rules/eslint/no_eq_null.rs index 80408e36e2430..c0cb2863f17e6 100644 --- a/crates/oxc_linter/src/rules/eslint/no_eq_null.rs +++ b/crates/oxc_linter/src/rules/eslint/no_eq_null.rs @@ -9,7 +9,7 @@ use std::fmt::Debug; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_eq_null_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-eq-null): Use '===' to compare with null") + OxcDiagnostic::warn("eslint(no-eq-null): Use '===' to compare with null") .with_help("Disallow `null` comparisons without type-checking operators.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_eval.rs b/crates/oxc_linter/src/rules/eslint/no_eval.rs index ba5f1df04e44c..c90cc1b67d55d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_eval.rs +++ b/crates/oxc_linter/src/rules/eslint/no_eval.rs @@ -10,7 +10,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_eval_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-eval): eval can be harmful.").with_labels([span0.into()]) + OxcDiagnostic::warn("eslint(no-eval): eval can be harmful.").with_labels([span0.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs b/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs index 9574d785e3703..546569d6a17f1 100644 --- a/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_ex_assign_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-ex-assign): Do not assign to the exception parameter.").with_help("If a catch clause in a try statement accidentally (or purposely) assigns another value to the exception parameter, it is impossible to refer to the error from that point on. Since there is no arguments object to offer alternative access to this data, assignment of the parameter is absolutely destructive.").with_labels([span0.into()]) + OxcDiagnostic::warn("eslint(no-ex-assign): Do not assign to the exception parameter.").with_help("If a catch clause in a try statement accidentally (or purposely) assigns another value to the exception parameter, it is impossible to refer to the error from that point on. Since there is no arguments object to offer alternative access to this data, assignment of the parameter is absolutely destructive.").with_labels([span0.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs index 4896ae31deb25..54035007f61cd 100644 --- a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs +++ b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs @@ -9,13 +9,13 @@ use oxc_syntax::operator::{LogicalOperator, UnaryOperator}; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_extra_double_negation_cast_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-extra-boolean-cast): Redundant double negation") + OxcDiagnostic::warn("eslint(no-extra-boolean-cast): Redundant double negation") .with_help("Remove the double negation as it will already be coerced to a boolean") .with_labels([span0.into()]) } fn no_extra_boolean_cast_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-extra-boolean-cast): Redundant Boolean call") + OxcDiagnostic::warn("eslint(no-extra-boolean-cast): Redundant Boolean call") .with_help("Remove the Boolean call as it will already be coerced to a boolean") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_func_assign.rs b/crates/oxc_linter/src/rules/eslint/no_func_assign.rs index 7e68cc475c5f1..d42b397701cb5 100644 --- a/crates/oxc_linter/src/rules/eslint/no_func_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_func_assign.rs @@ -8,7 +8,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_func_assign_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint(no-func-assign): '{x0}' is a function.")) + OxcDiagnostic::warn(format!("eslint(no-func-assign): '{x0}' is a function.")) .with_labels([LabeledSpan::new_with_span(Some(format!("{x0} is re-assigned here")), span1)]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_global_assign.rs b/crates/oxc_linter/src/rules/eslint/no_global_assign.rs index 7a7cfa93b71c4..87e72953176bc 100644 --- a/crates/oxc_linter/src/rules/eslint/no_global_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_global_assign.rs @@ -6,7 +6,7 @@ use oxc_span::{CompactStr, Span}; use crate::{context::LintContext, rule::Rule}; fn no_global_assign_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(no-global-assign): Read-only global '{x0}' should not be modified." )) .with_labels([LabeledSpan::new_with_span( diff --git a/crates/oxc_linter/src/rules/eslint/no_import_assign.rs b/crates/oxc_linter/src/rules/eslint/no_import_assign.rs index ceacc42dfad8f..b297739418929 100644 --- a/crates/oxc_linter/src/rules/eslint/no_import_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_import_assign.rs @@ -10,7 +10,7 @@ use phf::phf_set; use crate::{context::LintContext, rule::Rule}; fn no_import_assign_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-import-assign): do not assign to imported bindings") + OxcDiagnostic::warn("eslint(no-import-assign): do not assign to imported bindings") .with_help("imported bindings are readonly") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs b/crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs index 27393a1db3492..15db50520fee2 100644 --- a/crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs +++ b/crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_inner_declarations_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-inner-declarations): Variable or `function` declarations are not allowed in nested blocks") + OxcDiagnostic::warn("eslint(no-inner-declarations): Variable or `function` declarations are not allowed in nested blocks") .with_help(format!("Move {x0} declaration to {x1} root")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs b/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs index 61b7ec61cd253..b0662e9ed2398 100644 --- a/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs +++ b/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs @@ -6,7 +6,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_irregular_whitespace_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-irregular-whitespace): Unexpected irregular whitespace") + OxcDiagnostic::warn("eslint(no-irregular-whitespace): Unexpected irregular whitespace") .with_help("Try to remove the irregular whitespace") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_iterator.rs b/crates/oxc_linter/src/rules/eslint/no_iterator.rs index 270b6d0d3e3c6..553e568e3450b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_iterator.rs +++ b/crates/oxc_linter/src/rules/eslint/no_iterator.rs @@ -7,7 +7,7 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_iterator_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-iterator): Reserved name '__iterator__'") + OxcDiagnostic::warn("eslint(no-iterator): Reserved name '__iterator__'") .with_help("Disallow the use of the `__iterator__` property.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs b/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs index 9c50c7759fe7b..8e283de44a946 100644 --- a/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs +++ b/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs @@ -9,7 +9,7 @@ use std::borrow::Cow; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_loss_of_precision_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-loss-of-precision): This number literal will lose precision at runtime.", ) .with_labels([span0.into()]) diff --git a/crates/oxc_linter/src/rules/eslint/no_new_native_nonconstructor.rs b/crates/oxc_linter/src/rules/eslint/no_new_native_nonconstructor.rs index c806cc640e578..745f1c0b16add 100644 --- a/crates/oxc_linter/src/rules/eslint/no_new_native_nonconstructor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_new_native_nonconstructor.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_new_native_nonconstructor_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(no-new-native-nonconstructor): `{x0}` cannot be called as a constructor." )) .with_labels([span1.into()]) diff --git a/crates/oxc_linter/src/rules/eslint/no_new_wrappers.rs b/crates/oxc_linter/src/rules/eslint/no_new_wrappers.rs index 26ceb8fd51b9f..d535e1af423dc 100644 --- a/crates/oxc_linter/src/rules/eslint/no_new_wrappers.rs +++ b/crates/oxc_linter/src/rules/eslint/no_new_wrappers.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_new_wrappers_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-new-wrappers): Disallow new operators with the String, Number, and Boolean objects") + OxcDiagnostic::warn("eslint(no-new-wrappers): Disallow new operators with the String, Number, and Boolean objects") .with_help(format!("do not use {x0} as a constructor, consider removing the new operator.")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_nonoctal_decimal_escape.rs b/crates/oxc_linter/src/rules/eslint/no_nonoctal_decimal_escape.rs index 07d5573f41000..52774873ed161 100644 --- a/crates/oxc_linter/src/rules/eslint/no_nonoctal_decimal_escape.rs +++ b/crates/oxc_linter/src/rules/eslint/no_nonoctal_decimal_escape.rs @@ -8,7 +8,7 @@ use regex::{Captures, Regex}; use crate::{context::LintContext, rule::Rule, AstNode}; fn replacement(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(no-nonoctal-decimal-escape): Don't use '{x0}' escape sequence." )) .with_help(format!("Replace '{x0}' with '{x1}'. This maintains the current functionality.")) @@ -16,7 +16,7 @@ fn replacement(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { } fn escape_backslash(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(no-nonoctal-decimal-escape): Don't use '{x0}' escape sequence." )) .with_help(format!("Replace '{x0}' with '{x1}' to include the actual backslash character.")) diff --git a/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs b/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs index 1d5bdc32583be..65fb95448f82d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs +++ b/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs @@ -14,11 +14,9 @@ const GLOBAL_THIS: &str = "globalThis"; const NON_CALLABLE_GLOBALS: [&str; 5] = ["Atomics", "Intl", "JSON", "Math", "Reflect"]; fn no_obj_calls_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( - "eslint(no-obj-calls): Disallow calling some global objects as functions", - ) - .with_help(format!("{x0} is not a function.")) - .with_labels([span1.into()]) + OxcDiagnostic::warn("eslint(no-obj-calls): Disallow calling some global objects as functions") + .with_help(format!("{x0} is not a function.")) + .with_labels([span1.into()]) } #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/crates/oxc_linter/src/rules/eslint/no_proto.rs b/crates/oxc_linter/src/rules/eslint/no_proto.rs index a67992aebb4d2..69220b7927fac 100644 --- a/crates/oxc_linter/src/rules/eslint/no_proto.rs +++ b/crates/oxc_linter/src/rules/eslint/no_proto.rs @@ -7,7 +7,7 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_proto_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-proto): The '__proto__' property is deprecated") + OxcDiagnostic::warn("eslint(no-proto): The '__proto__' property is deprecated") .with_help("Disallow the use of the `__proto__` property.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_prototype_builtins.rs b/crates/oxc_linter/src/rules/eslint/no_prototype_builtins.rs index d4ef4cad328be..f7b3804462c87 100644 --- a/crates/oxc_linter/src/rules/eslint/no_prototype_builtins.rs +++ b/crates/oxc_linter/src/rules/eslint/no_prototype_builtins.rs @@ -7,7 +7,7 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_prototype_builtins_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint(no-prototype-builtins): do not access Object.prototype method {x0:?} from target object")) + OxcDiagnostic::warn(format!("eslint(no-prototype-builtins): do not access Object.prototype method {x0:?} from target object")) .with_help(format!("to avoid prototype pollution, use `Object.prototype.{x0}.call` instead")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_redeclare.rs b/crates/oxc_linter/src/rules/eslint/no_redeclare.rs index d256586d2c092..cf2732592baa4 100644 --- a/crates/oxc_linter/src/rules/eslint/no_redeclare.rs +++ b/crates/oxc_linter/src/rules/eslint/no_redeclare.rs @@ -10,16 +10,14 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_redeclare_diagnostic(x0: &str, span1: Span, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint(no-redeclare): '{x0}' is already defined.")).with_labels( - [ - LabeledSpan::new_with_span(Some(format!("'{x0}' is already defined.")), span1), - LabeledSpan::new_with_span(Some("It can not be redeclare here.".into()), span2), - ], - ) + OxcDiagnostic::warn(format!("eslint(no-redeclare): '{x0}' is already defined.")).with_labels([ + LabeledSpan::new_with_span(Some(format!("'{x0}' is already defined.")), span1), + LabeledSpan::new_with_span(Some("It can not be redeclare here.".into()), span2), + ]) } fn no_redeclare_as_builti_in_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(no-redeclare): '{x0}' is already defined as a built-in global variable." )) .with_labels([LabeledSpan::new_with_span( diff --git a/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs b/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs index 972a4aa700988..d44c7dc6e00bc 100644 --- a/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs +++ b/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs @@ -11,7 +11,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_regex_spaces_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-regex-spaces): Spaces are hard to count.") + OxcDiagnostic::warn("eslint(no-regex-spaces): Spaces are hard to count.") .with_help("Use a quantifier, e.g. {2}") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_script_url.rs b/crates/oxc_linter/src/rules/eslint/no_script_url.rs index 4a2e43f13cc4a..c70a44575f9a2 100644 --- a/crates/oxc_linter/src/rules/eslint/no_script_url.rs +++ b/crates/oxc_linter/src/rules/eslint/no_script_url.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_script_url_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-script-url): Script URL is a form of eval") + OxcDiagnostic::warn("eslint(no-script-url): Script URL is a form of eval") .with_help("Disallow `javascript:` urls") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_self_assign.rs b/crates/oxc_linter/src/rules/eslint/no_self_assign.rs index 5490d5d745802..e2a4fa7b2e98d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_self_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_self_assign.rs @@ -15,7 +15,7 @@ use oxc_syntax::operator::AssignmentOperator; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_self_assign_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-self-assign): this expression is assigned to itself") + OxcDiagnostic::warn("eslint(no-self-assign): this expression is assigned to itself") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_self_compare.rs b/crates/oxc_linter/src/rules/eslint/no_self_compare.rs index 294847a6390c8..d92883711cdad 100644 --- a/crates/oxc_linter/src/rules/eslint/no_self_compare.rs +++ b/crates/oxc_linter/src/rules/eslint/no_self_compare.rs @@ -7,7 +7,7 @@ use oxc_span::{GetSpan, Span}; use crate::{ast_util::calculate_hash, context::LintContext, rule::Rule, AstNode}; fn no_self_compare_diagnostic(span0: Span, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-self-compare): Disallow comparisons where both sides are exactly the same", ) .with_help("If you are testing for NaN, you can use Number.isNaN function.") diff --git a/crates/oxc_linter/src/rules/eslint/no_setter_return.rs b/crates/oxc_linter/src/rules/eslint/no_setter_return.rs index 565130dd3103d..cc9c14283d208 100644 --- a/crates/oxc_linter/src/rules/eslint/no_setter_return.rs +++ b/crates/oxc_linter/src/rules/eslint/no_setter_return.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_setter_return_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-setter-return): Setter cannot return a value") + OxcDiagnostic::warn("eslint(no-setter-return): Setter cannot return a value") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_shadow_restricted_names.rs b/crates/oxc_linter/src/rules/eslint/no_shadow_restricted_names.rs index 982f927d68464..7750295f22d1d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_shadow_restricted_names.rs +++ b/crates/oxc_linter/src/rules/eslint/no_shadow_restricted_names.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, globals::PRE_DEFINE_VAR, rule::Rule}; fn no_shadow_restricted_names_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-shadow-restricted-names): Shadowing of global properties such as 'undefined' is not allowed.") + OxcDiagnostic::warn("eslint(no-shadow-restricted-names): Shadowing of global properties such as 'undefined' is not allowed.") .with_help(format!("Shadowing of global properties '{x0}'.")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_sparse_arrays.rs b/crates/oxc_linter/src/rules/eslint/no_sparse_arrays.rs index a5a61a0b6eeb5..b5116f3f27afa 100644 --- a/crates/oxc_linter/src/rules/eslint/no_sparse_arrays.rs +++ b/crates/oxc_linter/src/rules/eslint/no_sparse_arrays.rs @@ -46,7 +46,7 @@ impl Rule for NoSparseArrays { if !violations.is_empty() { if violations.len() < 10 { ctx.diagnostic( - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-sparse-arrays): Unexpected comma in middle of array", ) .with_help("remove the comma or insert `undefined`") @@ -63,7 +63,7 @@ impl Rule for NoSparseArrays { }; ctx.diagnostic( - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(no-sparse-arrays): {} unexpected commas in middle of array", violations.len() )) diff --git a/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs b/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs index bc81ae265c594..11210b673a630 100644 --- a/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs +++ b/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_template_curly_in_string_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-template-curly-in-string): Unexpected template string expression", ) .with_help("Disallow template literal placeholder syntax in regular strings") diff --git a/crates/oxc_linter/src/rules/eslint/no_ternary.rs b/crates/oxc_linter/src/rules/eslint/no_ternary.rs index 2003bcb037fd5..61c064eb26c63 100644 --- a/crates/oxc_linter/src/rules/eslint/no_ternary.rs +++ b/crates/oxc_linter/src/rules/eslint/no_ternary.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_ternary_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-ternary): Unexpected use of ternary expression") + OxcDiagnostic::warn("eslint(no-ternary): Unexpected use of ternary expression") .with_help("Do not use the ternary expression.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs b/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs index f079237ae118b..8e3b6ecd59355 100644 --- a/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs +++ b/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs @@ -15,7 +15,7 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_this_before_super_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-this-before-super): Expected to always call super() before this/super property access.") + OxcDiagnostic::warn("eslint(no-this-before-super): Expected to always call super() before this/super property access.") .with_help("Call super() before this/super property access.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_undef.rs b/crates/oxc_linter/src/rules/eslint/no_undef.rs index 8791f036c7577..4fb6c0a625523 100644 --- a/crates/oxc_linter/src/rules/eslint/no_undef.rs +++ b/crates/oxc_linter/src/rules/eslint/no_undef.rs @@ -8,7 +8,7 @@ use oxc_syntax::operator::UnaryOperator; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_undef_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-undef): Disallow the use of undeclared variables.") + OxcDiagnostic::warn("eslint(no-undef): Disallow the use of undeclared variables.") .with_help(format!("'{x0}' is not defined.")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs b/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs index 944b4ed399ca6..5d28240d05d53 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs @@ -10,7 +10,7 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_unsafe_finally_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-unsafe-finally): Unsafe finally block") + OxcDiagnostic::warn("eslint(no-unsafe-finally): Unsafe finally block") .with_help("Control flow inside try or catch blocks will be overwritten by this statement") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_unsafe_negation.rs b/crates/oxc_linter/src/rules/eslint/no_unsafe_negation.rs index ac640272f12bc..28f6553c97fd8 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unsafe_negation.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unsafe_negation.rs @@ -11,7 +11,7 @@ use oxc_syntax::operator::{BinaryOperator, UnaryOperator}; use crate::{context::LintContext, fixer::Fix, rule::Rule, AstNode}; fn no_unsafe_negation_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("Unexpected logical not in the left hand side of '{x0}' operator")) + OxcDiagnostic::warn(format!("Unexpected logical not in the left hand side of '{x0}' operator")) .with_help(format!("use parenthesis to express the negation of the whole boolean expression, as '!' binds more closely than '{x0}'")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs b/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs index 9eb17e9c83ee0..1016acc455b4f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs @@ -11,13 +11,13 @@ use oxc_syntax::operator::LogicalOperator; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_unsafe_optional_chaining_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-unsafe-optional-chaining): Unsafe usage of optional chaining") + OxcDiagnostic::warn("eslint(no-unsafe-optional-chaining): Unsafe usage of optional chaining") .with_help("If this short-circuits with 'undefined' the evaluation will throw TypeError") .with_labels([span0.into()]) } fn no_unsafe_arithmetic_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(no-unsafe-optional-chaining): Unsafe arithmetic operation on optional chaining", ) .with_help("This can result in NaN.") diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_labels.rs b/crates/oxc_linter/src/rules/eslint/no_unused_labels.rs index f6b0bb3ba4a88..15d4a7925a65c 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_labels.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_labels.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, fixer::Fix, rule::Rule}; fn no_unused_labels_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-unused-labels): Disallow unused labels") + OxcDiagnostic::warn("eslint(no-unused-labels): Disallow unused labels") .with_help(format!("'{x0}:' is defined but never used.")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs b/crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs index f291c92d3b922..aa605eaa4dc4b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs @@ -10,7 +10,7 @@ use oxc_syntax::class::ElementKind; use crate::{context::LintContext, rule::Rule}; fn no_unused_private_class_members_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint(no-unused-private-class-members): '{x0}' is defined but never used." )) .with_labels([span1.into()]) diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs b/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs index 1b63292e5e266..f54de45d53ca3 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs @@ -10,14 +10,14 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_useless_catch_diagnostic(span0: Span, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-useless-catch): Unnecessary try/catch wrapper").with_labels([ + OxcDiagnostic::warn("eslint(no-useless-catch): Unnecessary try/catch wrapper").with_labels([ LabeledSpan::new_with_span(Some("is caught here".into()), span0), LabeledSpan::new_with_span(Some("and re-thrown here".into()), span1), ]) } fn no_useless_catch_finalizer_diagnostic(span0: Span, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-useless-catch): Unnecessary catch clause").with_labels([ + OxcDiagnostic::warn("eslint(no-useless-catch): Unnecessary catch clause").with_labels([ LabeledSpan::new_with_span(Some("is caught here".into()), span0), LabeledSpan::new_with_span(Some("and re-thrown here".into()), span1), ]) diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs b/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs index 786bc8f60f49d..f91f20b1ddb23 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs @@ -9,10 +9,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode, Fix}; fn no_useless_escape_diagnostic(x0: char, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( - "eslint(no-useless-escape): Unnecessary escape character {x0:?}" - )) - .with_labels([span1.into()]) + OxcDiagnostic::warn(format!("eslint(no-useless-escape): Unnecessary escape character {x0:?}")) + .with_labels([span1.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs b/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs index 4710c808d7b89..1e5d59ac7efde 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs @@ -11,7 +11,7 @@ use crate::{context::LintContext, rule::Rule, AstNode}; use oxc_span::GetSpan; fn no_useless_rename_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-useless-rename): Disallow renaming import, export, and destructured assignments to the same name") + OxcDiagnostic::warn("eslint(no-useless-rename): Disallow renaming import, export, and destructured assignments to the same name") .with_help("Either remove the renaming or rename the variable.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_var.rs b/crates/oxc_linter/src/rules/eslint/no_var.rs index a2bcad0e54278..2ebf3b49c95ec 100644 --- a/crates/oxc_linter/src/rules/eslint/no_var.rs +++ b/crates/oxc_linter/src/rules/eslint/no_var.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_var_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-var): Unexpected var, use let or const instead.") + OxcDiagnostic::warn("eslint(no-var): Unexpected var, use let or const instead.") .with_help("Replace var with let or const") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_void.rs b/crates/oxc_linter/src/rules/eslint/no_void.rs index 53b9ef0d9f2a1..0e2ec3322e6eb 100644 --- a/crates/oxc_linter/src/rules/eslint/no_void.rs +++ b/crates/oxc_linter/src/rules/eslint/no_void.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use oxc_syntax::operator::UnaryOperator; fn no_void_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-void): Disallow `void` operators") + OxcDiagnostic::warn("eslint(no-void): Disallow `void` operators") .with_help("Expected 'undefined' and instead saw 'void'.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/no_with.rs b/crates/oxc_linter/src/rules/eslint/no_with.rs index 26677c3716979..2f50768bb0dd5 100644 --- a/crates/oxc_linter/src/rules/eslint/no_with.rs +++ b/crates/oxc_linter/src/rules/eslint/no_with.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_with_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(no-with): Unexpected use of `with` statement.") + OxcDiagnostic::warn("eslint(no-with): Unexpected use of `with` statement.") .with_help("Do not use the `with` statement.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/radix.rs b/crates/oxc_linter/src/rules/eslint/radix.rs index b5fd551bbc81f..303a3b3ac5b30 100644 --- a/crates/oxc_linter/src/rules/eslint/radix.rs +++ b/crates/oxc_linter/src/rules/eslint/radix.rs @@ -9,19 +9,19 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; fn missing_parameters(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(radix): Missing parameters.").with_labels([span0.into()]) + OxcDiagnostic::warn("eslint(radix): Missing parameters.").with_labels([span0.into()]) } fn missing_radix(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(radix): Missing radix parameter.").with_labels([span0.into()]) + OxcDiagnostic::warn("eslint(radix): Missing radix parameter.").with_labels([span0.into()]) } fn redundant_radix(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(radix): Redundant radix parameter.").with_labels([span0.into()]) + OxcDiagnostic::warn("eslint(radix): Redundant radix parameter.").with_labels([span0.into()]) } fn invalid_radix(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint(radix): Invalid radix parameter, must be an integer between 2 and 36.", ) .with_labels([span0.into()]) diff --git a/crates/oxc_linter/src/rules/eslint/require_yield.rs b/crates/oxc_linter/src/rules/eslint/require_yield.rs index c7399f2511982..3d2bed207f795 100644 --- a/crates/oxc_linter/src/rules/eslint/require_yield.rs +++ b/crates/oxc_linter/src/rules/eslint/require_yield.rs @@ -7,7 +7,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn require_yield_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(require-yield): This generator function does not have 'yield'") + OxcDiagnostic::warn("eslint(require-yield): This generator function does not have 'yield'") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/unicode_bom.rs b/crates/oxc_linter/src/rules/eslint/unicode_bom.rs index 2ca5ff4321f07..9d74a62049627 100644 --- a/crates/oxc_linter/src/rules/eslint/unicode_bom.rs +++ b/crates/oxc_linter/src/rules/eslint/unicode_bom.rs @@ -5,13 +5,13 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, Fix}; fn unexpected_unicode_bom_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(unicode-bom): Unexpected Unicode BOM (Byte Order Mark)") + OxcDiagnostic::warn("eslint(unicode-bom): Unexpected Unicode BOM (Byte Order Mark)") .with_help("File must not begin with the Unicode BOM") .with_labels([span0.into()]) } fn expected_unicode_bom_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(unicode-bom): Expected Unicode BOM (Byte Order Mark)") + OxcDiagnostic::warn("eslint(unicode-bom): Expected Unicode BOM (Byte Order Mark)") .with_help("File must begin with the Unicode BOM") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/use_isnan.rs b/crates/oxc_linter/src/rules/eslint/use_isnan.rs index d562af67fb464..a006d5ab157cd 100644 --- a/crates/oxc_linter/src/rules/eslint/use_isnan.rs +++ b/crates/oxc_linter/src/rules/eslint/use_isnan.rs @@ -10,13 +10,13 @@ use oxc_syntax::operator::BinaryOperator; use crate::{context::LintContext, fixer::Fix, rule::Rule, AstNode}; fn comparison_with_na_n(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(use-isnan): Requires calls to isNaN() when checking for NaN") + OxcDiagnostic::warn("eslint(use-isnan): Requires calls to isNaN() when checking for NaN") .with_help("Use the isNaN function to compare with NaN.") .with_labels([span0.into()]) } fn switch_na_n(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(use-isnan): Requires calls to isNaN() when checking for NaN") + OxcDiagnostic::warn("eslint(use-isnan): Requires calls to isNaN() when checking for NaN") .with_help( "'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.", ) @@ -24,13 +24,13 @@ fn switch_na_n(span0: Span) -> OxcDiagnostic { } fn case_na_n(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(use-isnan): Requires calls to isNaN() when checking for NaN") + OxcDiagnostic::warn("eslint(use-isnan): Requires calls to isNaN() when checking for NaN") .with_help("'case NaN' can never match. Use Number.isNaN before the switch.") .with_labels([span0.into()]) } fn index_of_na_n(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(use-isnan): Requires calls to isNaN() when checking for NaN") + OxcDiagnostic::warn("eslint(use-isnan): Requires calls to isNaN() when checking for NaN") .with_help(format!("Array prototype method '{x0}' cannot find NaN.")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/eslint/valid_typeof.rs b/crates/oxc_linter/src/rules/eslint/valid_typeof.rs index 287398ca2b81a..987e76b054124 100644 --- a/crates/oxc_linter/src/rules/eslint/valid_typeof.rs +++ b/crates/oxc_linter/src/rules/eslint/valid_typeof.rs @@ -8,7 +8,7 @@ use phf::{phf_set, Set}; use crate::{context::LintContext, fixer::Fix, rule::Rule, AstNode}; fn not_string(x0: Option<&'static str>, span1: Span) -> OxcDiagnostic { - let mut d = OxcDiagnostic::warning( + let mut d = OxcDiagnostic::warn( "eslint(valid-typeof): Typeof comparisons should be to string literals.", ) .with_labels([span1.into()]); @@ -19,7 +19,7 @@ fn not_string(x0: Option<&'static str>, span1: Span) -> OxcDiagnostic { } fn invalid_value(x0: Option<&'static str>, span1: Span) -> OxcDiagnostic { - let mut d = OxcDiagnostic::warning("eslint(valid-typeof): Invalid typeof comparison value.") + let mut d = OxcDiagnostic::warn("eslint(valid-typeof): Invalid typeof comparison value.") .with_labels([span1.into()]); if let Some(x) = x0 { d = d.with_help(x); diff --git a/crates/oxc_linter/src/rules/import/default.rs b/crates/oxc_linter/src/rules/import/default.rs index f371d418e7a23..332e4d8c08527 100644 --- a/crates/oxc_linter/src/rules/import/default.rs +++ b/crates/oxc_linter/src/rules/import/default.rs @@ -7,7 +7,7 @@ use oxc_syntax::module_record::ImportImportName; use crate::{context::LintContext, rule::Rule}; fn default_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint-plugin-import(default): No default export found in imported module {x0:?}" )) .with_help(format!("does {x0:?} have the default export?")) diff --git a/crates/oxc_linter/src/rules/import/export.rs b/crates/oxc_linter/src/rules/import/export.rs index 904ae80ac002f..ece148042a9ed 100644 --- a/crates/oxc_linter/src/rules/import/export.rs +++ b/crates/oxc_linter/src/rules/import/export.rs @@ -9,7 +9,7 @@ use rustc_hash::{FxHashMap, FxHashSet}; use crate::{context::LintContext, rule::Rule}; fn no_named_export(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint-plugin-import(export): No named exports found in module '{x1}'" )) .with_labels([span0.into()]) @@ -89,7 +89,7 @@ impl Rule for Export { let labels = spans.into_iter().map(LabeledSpan::underline).collect::>(); ctx.diagnostic( - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint-plugin-import(export): Multiple exports of name '{name}'." )) .with_labels(labels), @@ -103,10 +103,8 @@ impl Rule for Export { spans.push(span); let labels = spans.into_iter().map(LabeledSpan::underline).collect::>(); ctx.diagnostic( - OxcDiagnostic::warning( - "eslint-plugin-import(export): Multiple default exports.", - ) - .with_labels(labels), + OxcDiagnostic::warn("eslint-plugin-import(export): Multiple default exports.") + .with_labels(labels), ); } } diff --git a/crates/oxc_linter/src/rules/import/named.rs b/crates/oxc_linter/src/rules/import/named.rs index 952b4fe846ca7..58b9f5ebd7125 100644 --- a/crates/oxc_linter/src/rules/import/named.rs +++ b/crates/oxc_linter/src/rules/import/named.rs @@ -7,7 +7,7 @@ use oxc_syntax::module_record::{ExportImportName, ImportImportName}; use crate::{context::LintContext, rule::Rule}; fn named_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-import(named): named import {x0:?} not found")) + OxcDiagnostic::warn(format!("eslint-plugin-import(named): named import {x0:?} not found")) .with_help(format!("does {x1:?} have the export {x0:?}?")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/import/namespace.rs b/crates/oxc_linter/src/rules/import/namespace.rs index 9c14f795d7d63..e5ca89e947402 100644 --- a/crates/oxc_linter/src/rules/import/namespace.rs +++ b/crates/oxc_linter/src/rules/import/namespace.rs @@ -13,25 +13,25 @@ use oxc_syntax::module_record::{ExportExportName, ExportImportName, ImportImport use crate::{context::LintContext, rule::Rule}; fn no_export(span0: Span, x1: &str, x2: &str) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint-plugin-import(namespace): {x1:?} not found in imported namespace {x2:?}." )) .with_labels([span0.into()]) } fn no_export_in_deeply_imported_namespace(span0: Span, x1: &str, x2: &str) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint-plugin-import(namespace): {x1:?} not found in deeply imported namespace {x2:?}." )) .with_labels([span0.into()]) } fn computed_reference(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-import(namespace): Unable to validate computed reference to imported namespace {x1:?}.")).with_labels([span0.into()]) + OxcDiagnostic::warn(format!("eslint-plugin-import(namespace): Unable to validate computed reference to imported namespace {x1:?}.")).with_labels([span0.into()]) } fn assignment(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint-plugin-import(namespace): Assignment to member of namespace {x1:?}.'" )) .with_labels([span0.into()]) diff --git a/crates/oxc_linter/src/rules/import/no_amd.rs b/crates/oxc_linter/src/rules/import/no_amd.rs index 0c283d325b900..9521b63172762 100644 --- a/crates/oxc_linter/src/rules/import/no_amd.rs +++ b/crates/oxc_linter/src/rules/import/no_amd.rs @@ -8,7 +8,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_amd_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-import(no-amd): Do not use AMD `require` and `define` calls.", ) .with_help(format!("Expected imports instead of AMD {x1}()")) diff --git a/crates/oxc_linter/src/rules/import/no_cycle.rs b/crates/oxc_linter/src/rules/import/no_cycle.rs index de620ba3cbe04..23e5c076ca4a5 100644 --- a/crates/oxc_linter/src/rules/import/no_cycle.rs +++ b/crates/oxc_linter/src/rules/import/no_cycle.rs @@ -13,7 +13,7 @@ use oxc_syntax::{ use crate::{context::LintContext, rule::Rule}; fn no_cycle_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-import(no-cycle): Dependency cycle detected") + OxcDiagnostic::warn("eslint-plugin-import(no-cycle): Dependency cycle detected") .with_help(format!("These paths form a cycle: \n{x1}")) .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/import/no_default_export.rs b/crates/oxc_linter/src/rules/import/no_default_export.rs index b5c4e9bb79f80..a99100655e997 100644 --- a/crates/oxc_linter/src/rules/import/no_default_export.rs +++ b/crates/oxc_linter/src/rules/import/no_default_export.rs @@ -6,7 +6,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_default_export_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-import(no-default-export): Prefer named exports") + OxcDiagnostic::warn("eslint-plugin-import(no-default-export): Prefer named exports") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/import/no_duplicates.rs b/crates/oxc_linter/src/rules/import/no_duplicates.rs index 1cb81ed8cb39a..b37ff52fc72f3 100644 --- a/crates/oxc_linter/src/rules/import/no_duplicates.rs +++ b/crates/oxc_linter/src/rules/import/no_duplicates.rs @@ -51,7 +51,7 @@ impl Rule for NoDuplicates { .iter() .map(|requested_module| LabeledSpan::underline(requested_module.span())) .collect::>(); - ctx.diagnostic(OxcDiagnostic::warning("eslint-plugin-import(no-duplicates): Forbid repeated import of the same module in multiple places").with_labels(labels)); + ctx.diagnostic(OxcDiagnostic::warn("eslint-plugin-import(no-duplicates): Forbid repeated import of the same module in multiple places").with_labels(labels)); } } }; diff --git a/crates/oxc_linter/src/rules/import/no_named_as_default.rs b/crates/oxc_linter/src/rules/import/no_named_as_default.rs index 53a73da93a3bd..577000f4d4178 100644 --- a/crates/oxc_linter/src/rules/import/no_named_as_default.rs +++ b/crates/oxc_linter/src/rules/import/no_named_as_default.rs @@ -7,7 +7,7 @@ use oxc_syntax::module_record::ImportImportName; use crate::{context::LintContext, rule::Rule}; fn no_named_as_default_diagnostic(span0: Span, x1: &str, x2: &str) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-import(no-named-as-default): Module {x2:?} has named export {x1:?}")) + OxcDiagnostic::warn(format!("eslint-plugin-import(no-named-as-default): Module {x2:?} has named export {x1:?}")) .with_help(format!("Using default import as {x1:?} can be confusing. Use another name for default import to avoid confusion.")) .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs b/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs index 1db024b499065..b0664eb1cfa53 100644 --- a/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs +++ b/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs @@ -21,7 +21,7 @@ fn no_named_as_default_member_dignostic( x2: &str, x3: &str, ) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint-plugin-import(no-named-as-default-member): {x1:?} also has a named export {x2:?}" )) .with_help(format!("Check if you meant to write `import {{{x2:}}} from {x3:?}`")) diff --git a/crates/oxc_linter/src/rules/import/no_self_import.rs b/crates/oxc_linter/src/rules/import/no_self_import.rs index 5c8e5ba0f5682..b5213bb78818f 100644 --- a/crates/oxc_linter/src/rules/import/no_self_import.rs +++ b/crates/oxc_linter/src/rules/import/no_self_import.rs @@ -6,7 +6,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_self_import_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-import(no-self-import): module importing itself is not allowed", ) .with_labels([span0.into()]) diff --git a/crates/oxc_linter/src/rules/import/no_unused_modules.rs b/crates/oxc_linter/src/rules/import/no_unused_modules.rs index e38d87470baf4..dcfe151ab5e3b 100644 --- a/crates/oxc_linter/src/rules/import/no_unused_modules.rs +++ b/crates/oxc_linter/src/rules/import/no_unused_modules.rs @@ -4,7 +4,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_exports_found(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-import(no-unused-modules): No exports found") + OxcDiagnostic::warn("eslint-plugin-import(no-unused-modules): No exports found") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/expect_expect.rs b/crates/oxc_linter/src/rules/jest/expect_expect.rs index 3b9c51b74fbe6..5d931712cc6ab 100644 --- a/crates/oxc_linter/src/rules/jest/expect_expect.rs +++ b/crates/oxc_linter/src/rules/jest/expect_expect.rs @@ -20,7 +20,7 @@ use crate::{ }; fn expect_expect_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(expect-expect): Test has no assertions") + OxcDiagnostic::warn("eslint-plugin-jest(expect-expect): Test has no assertions") .with_help("Add assertion(s) in this Test") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/max_expects.rs b/crates/oxc_linter/src/rules/jest/max_expects.rs index afc322327fbf4..a78b5e4f41403 100644 --- a/crates/oxc_linter/src/rules/jest/max_expects.rs +++ b/crates/oxc_linter/src/rules/jest/max_expects.rs @@ -13,7 +13,7 @@ use oxc_span::Span; use rustc_hash::{FxHashMap, FxHasher}; fn exceeded_max_assertion(x0: usize, x1: usize, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(max-expects): Enforces a maximum number assertion calls in a test body.") + OxcDiagnostic::warn("eslint-plugin-jest(max-expects): Enforces a maximum number assertion calls in a test body.") .with_help(format!("Too many assertion calls ({x0:?}) - maximum allowed is {x1:?}")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_alias_methods.rs b/crates/oxc_linter/src/rules/jest/no_alias_methods.rs index b38089961a4cd..1d5482f110604 100644 --- a/crates/oxc_linter/src/rules/jest/no_alias_methods.rs +++ b/crates/oxc_linter/src/rules/jest/no_alias_methods.rs @@ -12,7 +12,7 @@ use crate::{ }; fn no_alias_methods_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-jest(no-alias-methods): Unexpected alias {x0:?}")) + OxcDiagnostic::warn(format!("eslint-plugin-jest(no-alias-methods): Unexpected alias {x0:?}")) .with_help(format!("Replace {x0:?} with its canonical name of {x1:?}")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs b/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs index 4a6bb05830f80..93fa25f4f9b37 100644 --- a/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs @@ -8,7 +8,7 @@ use regex::Regex; use crate::{context::LintContext, rule::Rule}; fn no_commented_out_tests_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-commented-out-tests): Some tests seem to be commented", ) .with_help("Remove or uncomment this comment") diff --git a/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs b/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs index ce7f18c2674ae..1d6fb3cc6e50b 100644 --- a/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs @@ -16,11 +16,9 @@ use crate::{ }; fn no_conditional_expect_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( - "eslint-plugin-jest(no-conditional-expect): Unexpected conditional expect", - ) - .with_help("Avoid calling `expect` conditionally`") - .with_labels([span0.into()]) + OxcDiagnostic::warn("eslint-plugin-jest(no-conditional-expect): Unexpected conditional expect") + .with_help("Avoid calling `expect` conditionally`") + .with_labels([span0.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs b/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs index f47ec38ab871b..085f971f267ae 100644 --- a/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs +++ b/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs @@ -14,19 +14,19 @@ use crate::{ }; fn no_global_set_timeout_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-confusing-set-timeout)") + OxcDiagnostic::warn("eslint-plugin-jest(no-confusing-set-timeout)") .with_help("`jest.setTimeout` should be call in `global` scope") .with_labels([span0.into()]) } fn no_multiple_set_timeouts_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-confusing-set-timeout)") + OxcDiagnostic::warn("eslint-plugin-jest(no-confusing-set-timeout)") .with_help("Do not call `jest.setTimeout` multiple times, as only the last call will have an effect") .with_labels([span0.into()]) } fn no_unorder_set_timeout_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-confusing-set-timeout)") + OxcDiagnostic::warn("eslint-plugin-jest(no-confusing-set-timeout)") .with_help("`jest.setTimeout` should be placed before any other jest methods") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs b/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs index a6f8626428d03..294967b9d9d0a 100644 --- a/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs +++ b/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs @@ -9,7 +9,7 @@ use std::borrow::Cow; use crate::{context::LintContext, fixer::Fix, rule::Rule}; fn deprecated_function(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-deprecated-functions): Disallow use of deprecated functions", ) .with_help(format!("{x0:?} has been deprecated in favor of {x1:?}")) diff --git a/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs b/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs index eb03a57c98c39..f9e3248fa2a7d 100644 --- a/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs @@ -54,7 +54,7 @@ declare_oxc_lint!( ); fn no_disabled_tests_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-jest(no-disabled-tests): {x0:?}")) + OxcDiagnostic::warn(format!("eslint-plugin-jest(no-disabled-tests): {x0:?}")) .with_help(format!("{x1:?}")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_done_callback.rs b/crates/oxc_linter/src/rules/jest/no_done_callback.rs index 381e57e50a36f..a735f11ce8ffb 100644 --- a/crates/oxc_linter/src/rules/jest/no_done_callback.rs +++ b/crates/oxc_linter/src/rules/jest/no_done_callback.rs @@ -16,7 +16,7 @@ use crate::{ }; fn no_done_callback(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-done-callback): Function parameter(s) use the `done` argument", ) .with_help("Return a Promise instead of relying on callback parameter") @@ -24,7 +24,7 @@ fn no_done_callback(span0: Span) -> OxcDiagnostic { } fn use_await_instead_of_callback(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-done-callback): Function parameter(s) use the `done` argument", ) .with_help("Use await instead of callback in async functions") diff --git a/crates/oxc_linter/src/rules/jest/no_export.rs b/crates/oxc_linter/src/rules/jest/no_export.rs index 991468b76e24d..b2c3ed8975526 100644 --- a/crates/oxc_linter/src/rules/jest/no_export.rs +++ b/crates/oxc_linter/src/rules/jest/no_export.rs @@ -6,7 +6,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, utils::is_jest_file}; fn no_export_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-export): Do not export from a test file.") + OxcDiagnostic::warn("eslint-plugin-jest(no-export): Do not export from a test file.") .with_help("If you want to share code between tests, move it into a separate file and import it from there.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_focused_tests.rs b/crates/oxc_linter/src/rules/jest/no_focused_tests.rs index 41ee97a2a3b53..52ba5e1020d15 100644 --- a/crates/oxc_linter/src/rules/jest/no_focused_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_focused_tests.rs @@ -15,7 +15,7 @@ use crate::{ }; fn no_focused_tests_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-focused-tests): Unexpected focused test.") + OxcDiagnostic::warn("eslint-plugin-jest(no-focused-tests): Unexpected focused test.") .with_help("Remove focus from test.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_hooks.rs b/crates/oxc_linter/src/rules/jest/no_hooks.rs index b974bec2257b6..a88bd3bde2862 100644 --- a/crates/oxc_linter/src/rules/jest/no_hooks.rs +++ b/crates/oxc_linter/src/rules/jest/no_hooks.rs @@ -14,7 +14,7 @@ use crate::{ }; fn unexpected_hook_diagonsitc(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-hooks): Disallow setup and teardown hooks.") + OxcDiagnostic::warn("eslint-plugin-jest(no-hooks): Disallow setup and teardown hooks.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_identical_title.rs b/crates/oxc_linter/src/rules/jest/no_identical_title.rs index 96451c5d8b56a..d2c0eea9a312b 100644 --- a/crates/oxc_linter/src/rules/jest/no_identical_title.rs +++ b/crates/oxc_linter/src/rules/jest/no_identical_title.rs @@ -20,13 +20,13 @@ use crate::{ }; fn describe_repeat(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-identical-title): Describe block title is used multiple times in the same describe block.") + OxcDiagnostic::warn("eslint-plugin-jest(no-identical-title): Describe block title is used multiple times in the same describe block.") .with_help("Change the title of describe block.") .with_labels([span0.into()]) } fn test_repeat(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-identical-title): Test title is used multiple times in the same describe block.").with_help("Change the title of test.").with_labels([span0.into()]) + OxcDiagnostic::warn("eslint-plugin-jest(no-identical-title): Test title is used multiple times in the same describe block.").with_help("Change the title of test.").with_labels([span0.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs b/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs index 0435cd165b03b..1df594fbf34ab 100644 --- a/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs +++ b/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs @@ -11,7 +11,7 @@ use crate::{ }; fn no_interpolation_in_snapshots_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-interpolation-in-snapshots): Do not use string interpolation inside of snapshots") + OxcDiagnostic::warn("eslint-plugin-jest(no-interpolation-in-snapshots): Do not use string interpolation inside of snapshots") .with_help("Remove string interpolation from snapshots") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs b/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs index cae309555a8f7..ba6b9d6178f85 100644 --- a/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs +++ b/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs @@ -12,7 +12,7 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, Fix}; fn no_jasmine_globals_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-jest(no-jasmine-globals): {x0:?}")) + OxcDiagnostic::warn(format!("eslint-plugin-jest(no-jasmine-globals): {x0:?}")) .with_help(format!("{x1:?}")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_mocks_import.rs b/crates/oxc_linter/src/rules/jest/no_mocks_import.rs index fe9bea6e397d2..e48c218364740 100644 --- a/crates/oxc_linter/src/rules/jest/no_mocks_import.rs +++ b/crates/oxc_linter/src/rules/jest/no_mocks_import.rs @@ -9,7 +9,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; fn no_mocks_import_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-mocks-import): Mocks should not be manually imported from a `__mocks__` directory.") + OxcDiagnostic::warn("eslint-plugin-jest(no-mocks-import): Mocks should not be manually imported from a `__mocks__` directory.") .with_help("Instead use `jest.mock` and import from the original module path.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs b/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs index 598652167cb48..63442dbfa8add 100644 --- a/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs +++ b/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs @@ -15,7 +15,7 @@ use rustc_hash::{FxHashMap, FxHasher}; use std::{collections::HashMap, hash::BuildHasherDefault}; fn restricted_jest_method(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-restricted-jest-methods): Disallow specific `jest.` methods", ) .with_help(format!("Use of `{x0:?}` is disallowed")) @@ -23,7 +23,7 @@ fn restricted_jest_method(x0: &str, span1: Span) -> OxcDiagnostic { } fn restricted_jest_method_with_message(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-restricted-jest-methods): Disallow specific `jest.` methods", ) .with_help(format!("{x0:?}")) diff --git a/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs b/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs index 987c2307e3d89..af522167e3222 100644 --- a/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs +++ b/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs @@ -16,7 +16,7 @@ use rustc_hash::{FxHashMap, FxHasher}; use std::{collections::HashMap, hash::BuildHasherDefault, path::Path}; fn restricted_chain(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-restricted-matchers): Disallow specific matchers & modifiers", ) .with_help(format!("Use of `{x0:?}` is disallowed`")) @@ -24,7 +24,7 @@ fn restricted_chain(x0: &str, span1: Span) -> OxcDiagnostic { } fn restricted_chain_with_message(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-restricted-matchers): Disallow specific matchers & modifiers", ) .with_help(format!("{x0:?}")) diff --git a/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs b/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs index adf9c2dfb5841..a3feaa6754325 100644 --- a/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs @@ -19,7 +19,7 @@ use crate::{ }; fn no_standalone_expect_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.", ) .with_help("Did you forget to wrap `expect` in a `test` or `it` block?") diff --git a/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs b/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs index a4e2e4a5aa422..811c5ffd04eae 100644 --- a/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs +++ b/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs @@ -15,7 +15,7 @@ use crate::{ }; fn no_test_prefixes_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-jest(no-test-prefixes): Use {x0:?} instead.")) + OxcDiagnostic::warn(format!("eslint-plugin-jest(no-test-prefixes): Use {x0:?} instead.")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs b/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs index d59849a27ad63..2a14ffd79cf94 100644 --- a/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs +++ b/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs @@ -15,7 +15,7 @@ use oxc_semantic::AstNode; use oxc_span::{GetSpan, Span}; fn no_test_return_statement_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(no-test-return-statement): Jest tests should not return a value", ) .with_labels([span0.into()]) diff --git a/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs b/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs index 1faa53989a845..5f6f69d816b31 100644 --- a/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs +++ b/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs @@ -14,7 +14,7 @@ use oxc_macros::declare_oxc_lint; use oxc_span::Span; fn add_type_parameter_to_module_mock_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(no-untyped-mock-factory): Disallow using `jest.mock()` factories without an explicit type parameter.") + OxcDiagnostic::warn("eslint-plugin-jest(no-untyped-mock-factory): Disallow using `jest.mock()` factories without an explicit type parameter.") .with_help(format!("Add a type parameter to the mock factory such as `typeof import({x0:?})`")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/prefer_called_with.rs b/crates/oxc_linter/src/rules/jest/prefer_called_with.rs index bc8edef038fcf..5738c9df6cb57 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_called_with.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_called_with.rs @@ -10,13 +10,13 @@ use oxc_macros::declare_oxc_lint; use oxc_span::Span; fn use_to_be_called_with(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-called-with): Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-called-with): Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`.") .with_help("Prefer toBeCalledWith(/* expected args */)") .with_labels([span0.into()]) } fn use_have_been_called_with(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-called-with): Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-called-with): Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`.") .with_help("Prefer toHaveBeenCalledWith(/* expected args */)") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs b/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs index d8d534d270506..791b8f155cc98 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs @@ -18,7 +18,7 @@ use oxc_span::Span; use oxc_syntax::operator::BinaryOperator; fn use_to_be_comparison(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-comparison-matcher): Suggest using the built-in comparison matchers") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-comparison-matcher): Suggest using the built-in comparison matchers") .with_help(format!("Prefer using `{x0:?}` instead")) .with_labels([span1.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs b/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs index c4b038e0c660e..646506725feb8 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs @@ -14,7 +14,7 @@ use oxc_span::Span; use oxc_syntax::operator::BinaryOperator; fn use_equality_matcher_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-equality-matcher): Suggest using the built-in equality matchers.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-equality-matcher): Suggest using the built-in equality matchers.") .with_help("Prefer using one of the equality matchers instead") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs b/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs index 49d50c52847cb..9c3c6df1651a9 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs @@ -18,7 +18,7 @@ use crate::{ }; fn expect_resolves(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-expect-resolves): Prefer `await expect(...).resolves` over `expect(await ...)` syntax.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-expect-resolves): Prefer `await expect(...).resolves` over `expect(await ...)` syntax.") .with_help("Use `await expect(...).resolves` instead") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs b/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs index c5f97c0a12cf9..e37cf41e6637e 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs @@ -15,11 +15,9 @@ use crate::{ }; fn unexpected_lowercase(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( - "eslint-plugin-jest(prefer-lowercase-title): Enforce lowercase test names", - ) - .with_help(format!("`{x0:?}`s should begin with lowercase")) - .with_labels([span1.into()]) + OxcDiagnostic::warn("eslint-plugin-jest(prefer-lowercase-title): Enforce lowercase test names") + .with_help(format!("`{x0:?}`s should begin with lowercase")) + .with_labels([span1.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs b/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs index e4220e134bc0d..d7b9128044fd1 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs @@ -10,7 +10,7 @@ use oxc_span::{Atom, Span}; use crate::{context::LintContext, fixer::Fix, rule::Rule, utils::get_node_name}; fn use_mock_shorthand(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-mock-promise-shorthand): Prefer mock resolved/rejected shorthands for promises").with_help(format!("Prefer {x0:?}")).with_labels([span1.into()]) + OxcDiagnostic::warn("eslint-plugin-jest(prefer-mock-promise-shorthand): Prefer mock resolved/rejected shorthands for promises").with_help(format!("Prefer {x0:?}")).with_labels([span1.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs b/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs index 4d115d1fafc19..8f4d7daa1c613 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs @@ -19,7 +19,7 @@ use crate::{ }; fn use_jest_spy_on(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-spy-on): Suggest using `jest.spyOn()`.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-spy-on): Suggest using `jest.spyOn()`.") .with_help("Use jest.spyOn() instead") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs b/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs index 2e02c0c237263..f7ddb92c71d49 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs @@ -11,11 +11,9 @@ use oxc_macros::declare_oxc_lint; use oxc_span::Span; fn use_to_strict_equal(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( - "eslint-plugin-jest(prefer-strict-equal): Suggest using `toStrictEqual()`.", - ) - .with_help("Use `toStrictEqual()` instead") - .with_labels([span0.into()]) + OxcDiagnostic::warn("eslint-plugin-jest(prefer-strict-equal): Suggest using `toStrictEqual()`.") + .with_help("Use `toStrictEqual()` instead") + .with_labels([span0.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_to_be.rs b/crates/oxc_linter/src/rules/jest/prefer_to_be.rs index 89abc142f189d..878725a8decfd 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_be.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_be.rs @@ -18,29 +18,29 @@ use crate::{ }; fn use_to_be(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.", ) .with_labels([span0.into()]) } fn use_to_be_undefined(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.") .with_labels([span0.into()]) } fn use_to_be_defined(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.") .with_labels([span0.into()]) } fn use_to_be_null(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.") .with_labels([span0.into()]) } fn use_to_be_na_n(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs b/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs index a9ce8690bcd2a..560d0d50fe2cc 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs @@ -17,7 +17,7 @@ use crate::{ }; fn use_to_contain(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-to-contain): Suggest using `toContain()`.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-contain): Suggest using `toContain()`.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs b/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs index d83c2e33902cf..eba6ec8a1b949 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs @@ -18,7 +18,7 @@ use crate::{ }; fn use_to_have_length(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(prefer-to-have-length): Suggest using `toHaveLength()`.", ) .with_labels([span0.into()]) diff --git a/crates/oxc_linter/src/rules/jest/prefer_todo.rs b/crates/oxc_linter/src/rules/jest/prefer_todo.rs index 74b46fd0d5c85..d92216c281edb 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_todo.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_todo.rs @@ -18,12 +18,12 @@ use crate::{ }; fn empty_test(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-todo): Suggest using `test.todo`.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-todo): Suggest using `test.todo`.") .with_labels([span0.into()]) } fn un_implemented_test_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jest(prefer-todo): Suggest using `test.todo`.") + OxcDiagnostic::warn("eslint-plugin-jest(prefer-todo): Suggest using `test.todo`.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/require_hook.rs b/crates/oxc_linter/src/rules/jest/require_hook.rs index 135b07f862f59..2953979e99564 100644 --- a/crates/oxc_linter/src/rules/jest/require_hook.rs +++ b/crates/oxc_linter/src/rules/jest/require_hook.rs @@ -19,7 +19,7 @@ use crate::{ }; fn use_hook(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jest(require-hook): Require setup and teardown code to be within a hook.", ) .with_help("This should be done within a hook") diff --git a/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs b/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs index f8be3c1ddabee..c71d674b43416 100644 --- a/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs +++ b/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs @@ -11,7 +11,7 @@ use crate::{ }; fn require_to_throw_message_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!( + OxcDiagnostic::warn(format!( "eslint-plugin-jest(require-to-throw-message): Require a message for {x0:?}." )) .with_help(format!("Add an error message to {x0:?}")) diff --git a/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs b/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs index 044e366589b0d..2b05dfa85dbc1 100644 --- a/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs +++ b/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs @@ -17,7 +17,7 @@ use crate::{ }; fn valid_describe_callback_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-jest(valid-describe-callback): {x0:?}")) + OxcDiagnostic::warn(format!("eslint-plugin-jest(valid-describe-callback): {x0:?}")) .with_help(format!("{x1:?}")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/valid_expect.rs b/crates/oxc_linter/src/rules/jest/valid_expect.rs index 7676f92f5af13..a27b3c56554f6 100644 --- a/crates/oxc_linter/src/rules/jest/valid_expect.rs +++ b/crates/oxc_linter/src/rules/jest/valid_expect.rs @@ -17,7 +17,7 @@ use crate::{ }; fn valid_expect_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-jest(valid-expect): {x0:?}")) + OxcDiagnostic::warn(format!("eslint-plugin-jest(valid-expect): {x0:?}")) .with_help(format!("{x1:?}")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/jest/valid_title.rs b/crates/oxc_linter/src/rules/jest/valid_title.rs index 0b92851f5f810..463e7c80ed3d4 100644 --- a/crates/oxc_linter/src/rules/jest/valid_title.rs +++ b/crates/oxc_linter/src/rules/jest/valid_title.rs @@ -20,7 +20,7 @@ use crate::{ }; fn valid_title_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-jest(valid-title): {x0:?}")) + OxcDiagnostic::warn(format!("eslint-plugin-jest(valid-title): {x0:?}")) .with_help(format!("{x1:?}")) .with_labels([span2.into()]) } diff --git a/crates/oxc_linter/src/rules/jsdoc/check_access.rs b/crates/oxc_linter/src/rules/jsdoc/check_access.rs index 2499cb0adb0a5..3e84237b10602 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_access.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_access.rs @@ -7,7 +7,7 @@ use rustc_hash::FxHashSet; use crate::{context::LintContext, rule::Rule, utils::should_ignore_as_internal}; fn invalid_access_level(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsdoc(check-access): Invalid access level is specified or missing.", ) .with_help("Valid access levels are `package`, `private`, `protected`, and `public`.") @@ -15,7 +15,7 @@ fn invalid_access_level(span0: Span) -> OxcDiagnostic { } fn redundant_access_tags(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsdoc(check-access): Mixing of @access with @public, @private, @protected, or @package on the same doc block.") + OxcDiagnostic::warn("eslint-plugin-jsdoc(check-access): Mixing of @access with @public, @private, @protected, or @package on the same doc block.") .with_help("There should be only one instance of access tag in a JSDoc comment.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs b/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs index dbc61a9503fe1..a2201c2d15f12 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs @@ -10,7 +10,7 @@ use crate::{ }; fn no_root(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsdoc(check-property-names): No root defined for @property path.", ) .with_help(format!("@property path declaration `{x1}` appears before any real property.")) @@ -108,7 +108,7 @@ impl Rule for CheckPropertyNames { }) .collect::>(); ctx.diagnostic( - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsdoc(check-property-names): Duplicate @property found.", ) .with_help(format!("@property `{type_name}` is duplicated on the same block.")) diff --git a/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs b/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs index 96cb87005d3d7..4e83e95e87173 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs @@ -12,7 +12,7 @@ use crate::{ }; fn check_tag_names_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsdoc(check-tag-names): Invalid tag name found.") + OxcDiagnostic::warn("eslint-plugin-jsdoc(check-tag-names): Invalid tag name found.") .with_help(x1.to_string()) .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs b/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs index 11d5fd5ab0db0..a640cca474de9 100644 --- a/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs +++ b/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs @@ -8,7 +8,7 @@ use serde::Deserialize; use crate::{context::LintContext, rule::Rule, utils::should_ignore_as_private}; fn empty_tags_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsdoc(empty-tags): Expects the void tags to be empty of any content.", ) .with_help(format!("`@{x1}` tag should not have body.")) diff --git a/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs b/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs index 3fe116837e9ae..42f3331723a63 100644 --- a/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs +++ b/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs @@ -12,7 +12,7 @@ use oxc_macros::declare_oxc_lint; use oxc_span::Span; fn implements_on_classes_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsdoc(implements-on-classes): `@implements` used on a non-constructor function") + OxcDiagnostic::warn("eslint-plugin-jsdoc(implements-on-classes): `@implements` used on a non-constructor function") .with_help("Add `@class` tag or use ES6 class syntax.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs b/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs index 2fd0cf552bc55..56fbf2a733402 100644 --- a/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs +++ b/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs @@ -13,7 +13,7 @@ use crate::{ }; fn no_defaults_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsdoc(no-defaults): Defaults are not permitted.") + OxcDiagnostic::warn("eslint-plugin-jsdoc(no-defaults): Defaults are not permitted.") .with_help(x1.to_string()) .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property.rs b/crates/oxc_linter/src/rules/jsdoc/require_property.rs index 27f8db98320a4..2c7ea4ca68664 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property.rs @@ -10,7 +10,7 @@ use crate::{ }; fn require_property_diagnostic(span: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsdoc(require-property): The `@typedef` and `@namespace` tags must include a `@property` tag with the type Object.") + OxcDiagnostic::warn("eslint-plugin-jsdoc(require-property): The `@typedef` and `@namespace` tags must include a `@property` tag with the type Object.") .with_help("Consider adding a `@property` tag or replacing it with a more specific type.") .and_label(span) } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs b/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs index 8d8ded15b2ed2..ae5b16e9e90b8 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs @@ -10,7 +10,7 @@ use crate::{ }; fn require_property_description_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsdoc(require-property-description): Missing description in @property tag.", ) .with_help("Add a description to this @property tag.") diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs b/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs index 2ac229a9ac144..41f629a70711f 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs @@ -10,7 +10,7 @@ use crate::{ }; fn require_property_name_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsdoc(require-property-name): Missing name in @property tag.", ) .with_help("Add a type name to this @property tag.") diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs b/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs index 522e0cedea540..3f6918744f19f 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs @@ -10,7 +10,7 @@ use crate::{ }; fn require_property_type_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsdoc(require-property-type): Missing type in @property tag.", ) .with_help("Add a {type} to this @property tag.") diff --git a/crates/oxc_linter/src/rules/jsdoc/require_yields.rs b/crates/oxc_linter/src/rules/jsdoc/require_yields.rs index 7a8c95e1e857a..97b2af6be28c7 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_yields.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_yields.rs @@ -18,19 +18,19 @@ use crate::{ }; fn missing_yields(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsdoc(require-yields): Missing JSDoc `@yields` declaration for generator function.") + OxcDiagnostic::warn("eslint-plugin-jsdoc(require-yields): Missing JSDoc `@yields` declaration for generator function.") .with_help("Add `@yields` tag to the JSDoc comment.") .with_labels([span0.into()]) } fn duplicate_yields(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsdoc(require-yields): Duplicate `@yields` tags.") + OxcDiagnostic::warn("eslint-plugin-jsdoc(require-yields): Duplicate `@yields` tags.") .with_help("Remove redundunt `@yields` tag.") .with_labels([span0.into()]) } fn missing_yields_with_generator(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsdoc(require-yields): `@yields` tag is required when using `@generator` tag.") + OxcDiagnostic::warn("eslint-plugin-jsdoc(require-yields): `@yields` tag is required when using `@generator` tag.") .with_help("Add `@yields` tag to the JSDoc comment.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs b/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs index 2c155c19bcc7a..fc3826d543360 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs @@ -13,13 +13,13 @@ use crate::utils::{ use crate::{context::LintContext, rule::Rule, AstNode}; fn missing_alt_prop(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(alt-text): Missing `alt` attribute.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Missing `alt` attribute.") .with_help("Must have `alt` prop, either with meaningful text, or an empty string for decorative images.") .with_labels([span0.into()]) } fn missing_alt_value(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(alt-text): Invalid `alt` value.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Invalid `alt` value.") .with_help( "Must have meaningful value for `alt` prop. Use alt=\"\" for presentational images.", ) @@ -27,13 +27,13 @@ fn missing_alt_value(span0: Span) -> OxcDiagnostic { } fn aria_label_value(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(alt-text): Missing value for aria-label attribute.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Missing value for aria-label attribute.") .with_help("The aria-label attribute must have a value. The alt attribute is preferred over aria-label for images.") .with_labels([span0.into()]) } fn aria_labelled_by_value(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsx-a11y(alt-text): Missing value for aria-labelledby attribute.", ) .with_help("The alt attribute is preferred over aria-labelledby for images.") @@ -41,25 +41,25 @@ fn aria_labelled_by_value(span0: Span) -> OxcDiagnostic { } fn prefer_alt(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(alt-text): ARIA used where native HTML could suffice.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): ARIA used where native HTML could suffice.") .with_help("Prefer alt=\"\" over presentational role. Native HTML attributes should be preferred for accessibility before resorting to ARIA attributes.") .with_labels([span0.into()]) } fn object(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(alt-text): Missing alternative text.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Missing alternative text.") .with_help("Embedded elements must have a text alternative through the `alt`, `aria-label`, or `aria-labelledby` prop.") .with_labels([span0.into()]) } fn area(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(alt-text): Missing alternative text.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Missing alternative text.") .with_help("Each area of an image map must have a text alternative through the `alt`, `aria-label`, or `aria-labelledby` prop.") .with_labels([span0.into()]) } fn input_type_image(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(alt-text): Missing alternative text.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Missing alternative text.") .with_help(" elements with type=\"image\" must have a text alternative through the `alt`, `aria-label`, or `aria-labelledby` prop.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs b/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs index 0f9e87025efa7..10164c9696dd7 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs @@ -14,13 +14,13 @@ use crate::{ }; fn missing_content(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(anchor-has-content): Missing accessible content when using `a` elements.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(anchor-has-content): Missing accessible content when using `a` elements.") .with_help("Provide screen reader accessible content when using `a` elements.") .with_labels([span0.into()]) } fn remove_aria_hidden(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(anchor-has-content): Missing accessible content when using `a` elements.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(anchor-has-content): Missing accessible content when using `a` elements.") .with_help("Remove the `aria-hidden` attribute to allow the anchor element and its content visible to assistive technologies.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs b/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs index 231dfebf17378..048aa42fb1294 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs @@ -14,7 +14,7 @@ use crate::{ }; fn missing_href_attribute(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsx-a11y(anchor-is-valid): Missing `href` attribute for the `a` element.", ) .with_help("Provide an href for the `a` element.") @@ -22,7 +22,7 @@ fn missing_href_attribute(span0: Span) -> OxcDiagnostic { } fn incorrect_href(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsx-a11y(anchor-is-valid): Use an incorrect href for the 'a' element.", ) .with_help("Provide a correct href for the `a` element.") @@ -30,7 +30,7 @@ fn incorrect_href(span0: Span) -> OxcDiagnostic { } fn cant_be_anchor(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( + OxcDiagnostic::warn( "eslint-plugin-jsx-a11y(anchor-is-valid): The a element has `href` and `onClick`.", ) .with_help("Use a `button` element instead of an `a` element.") diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs index 19c533b8cb1da..8beb09e4b41d2 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs @@ -16,7 +16,7 @@ use crate::{ }; fn aria_activedescendant_has_tabindex_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(aria-activedescendant-has-tabindex): Enforce elements with aria-activedescendant are tabbable.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(aria-activedescendant-has-tabindex): Enforce elements with aria-activedescendant are tabbable.") .with_help("An element that manages focus with `aria-activedescendant` must have a tabindex.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs index 5a26a45b42b5f..b895ffb8df84a 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs @@ -10,7 +10,7 @@ use crate::{ }; fn aria_props_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(aria-props): Invalid ARIA prop.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(aria-props): Invalid ARIA prop.") .with_help(format!("`{x1}` is an invalid ARIA attribute.")) .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs index d8bd21e75e988..bfadafa907d14 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs @@ -16,7 +16,7 @@ use crate::{ }; fn aria_role_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(aria-role): Elements with ARIA roles must use a valid, non-abstract ARIA role.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(aria-role): Elements with ARIA roles must use a valid, non-abstract ARIA role.") .with_help(format!("Set a valid, non-abstract ARIA role for element with ARIA{x1}")) .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs index c05c3b29f9d9b..d6bb13467bf62 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs @@ -35,7 +35,7 @@ declare_oxc_lint! { pub struct AriaUnsupportedElements; fn aria_unsupported_elements_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(aria-unsupported-elements): This element does not support ARIA roles, states and properties.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(aria-unsupported-elements): This element does not support ARIA roles, states and properties.") .with_help(format!("Try removing the prop `{x1}`.")) .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs b/crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs index c91a15dcbe1b5..2bcce01c4545f 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs @@ -15,7 +15,7 @@ use oxc_span::Span; use phf::{phf_map, phf_set}; fn autocomplete_valid_diagnostic(span: Span, autocomplete: &str) -> OxcDiagnostic { - OxcDiagnostic::warning(format!("eslint-plugin-jsx-a11y(autocomplete-valid): `{autocomplete}` is not a valid value for autocomplete.")) + OxcDiagnostic::warn(format!("eslint-plugin-jsx-a11y(autocomplete-valid): `{autocomplete}` is not a valid value for autocomplete.")) .with_help(format!("Change `{autocomplete}` to a valid value for autocomplete.")) .with_label(span) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs b/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs index 574000a66ba89..7df87b3b48280 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs @@ -16,7 +16,7 @@ use crate::{ }; fn click_events_have_key_events_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(click-events-have-key-events): Enforce a clickable non-interactive element has at least one keyboard event listener.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(click-events-have-key-events): Enforce a clickable non-interactive element has at least one keyboard event listener.") .with_help("Visible, non-interactive elements with click handlers must have one of keyup, keydown, or keypress listener.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs b/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs index c76aa4ae4301a..cd6378c499440 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs @@ -12,7 +12,7 @@ use crate::{ }; fn heading_has_content_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint(heading-has-content): Headings must have content and the content must be accessible by a screen reader.") + OxcDiagnostic::warn("eslint(heading-has-content): Headings must have content and the content must be accessible by a screen reader.") .with_help("Provide screen reader accessible content when using heading elements.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs b/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs index b783ad9b30293..ed3b21f77f8be 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs @@ -14,17 +14,15 @@ use crate::{ }; fn missing_lang_prop(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(html-has-lang): Missing lang attribute.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(html-has-lang): Missing lang attribute.") .with_help("Add a lang attribute to the html element whose value represents the primary language of document.") .with_labels([span0.into()]) } fn missing_lang_value(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning( - "eslint-plugin-jsx-a11y(html-has-lang): Missing value for lang attribute", - ) - .with_help("Must have meaningful value for `lang` prop.") - .with_labels([span0.into()]) + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(html-has-lang): Missing value for lang attribute") + .with_help("Must have meaningful value for `lang` prop.") + .with_labels([span0.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs b/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs index b0691bd90ad8d..98963ed2286b0 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs @@ -15,7 +15,7 @@ use crate::{ }; fn iframe_has_title_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(iframe-has-title): Missing `title` attribute for the `iframe` element.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(iframe-has-title): Missing `title` attribute for the `iframe` element.") .with_help("Provide title property for iframe element.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs b/crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs index bc0b90a53b230..f9230f9dc6bce 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs @@ -15,7 +15,7 @@ use crate::utils::{ use crate::{context::LintContext, rule::Rule, AstNode}; fn img_redundant_alt_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(img-redundant-alt): Redundant alt attribute.").with_help("Provide no redundant alt text for image. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop.").with_labels([span0.into()]) + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(img-redundant-alt): Redundant alt attribute.").with_help("Provide no redundant alt text for image. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop.").with_labels([span0.into()]) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/lang.rs b/crates/oxc_linter/src/rules/jsx_a11y/lang.rs index 6f9ffad7e2f3d..5e14107e5cc58 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/lang.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/lang.rs @@ -16,7 +16,7 @@ use crate::{ }; fn lang_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(lang): Lang attribute must have a valid value.") + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(lang): Lang attribute must have a valid value.") .with_help("Set a valid value for lang attribute.") .with_labels([span0.into()]) } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs b/crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs index 902e95b7d99ac..9028d75677ece 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs @@ -10,7 +10,7 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, utils::get_element_type, AstNode}; fn media_has_caption_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warning("eslint-plugin-jsx-a11y(media-has-caption): Missing element with captions inside