diff --git a/crates/oxc_linter/src/rules/eslint/func_names.rs b/crates/oxc_linter/src/rules/eslint/func_names.rs index 5353c23c6..27f51314e 100644 --- a/crates/oxc_linter/src/rules/eslint/func_names.rs +++ b/crates/oxc_linter/src/rules/eslint/func_names.rs @@ -28,7 +28,7 @@ impl TryFrom<&serde_json::Value> for FuncNamesConfig { fn try_from(raw: &serde_json::Value) -> Result { if !raw.is_string() { - return Err(OxcDiagnostic::error(format!( + return Err(OxcDiagnostic::warn(format!( "Expecting string for eslint/func-names configuration, got {raw}" ))); } @@ -37,7 +37,7 @@ impl TryFrom<&serde_json::Value> for FuncNamesConfig { "always" => Ok(FuncNamesConfig::Always), "as-needed" => Ok(FuncNamesConfig::AsNeeded), "never" => Ok(FuncNamesConfig::Never), - v => Err(OxcDiagnostic::error(format!( + v => Err(OxcDiagnostic::warn(format!( "Expecting always, as-needed or never for eslint/func-names configuration, got {v}" ))), } diff --git a/crates/oxc_linter/src/rules/eslint/no_fallthrough.rs b/crates/oxc_linter/src/rules/eslint/no_fallthrough.rs index 19f968b24..32396f973 100644 --- a/crates/oxc_linter/src/rules/eslint/no_fallthrough.rs +++ b/crates/oxc_linter/src/rules/eslint/no_fallthrough.rs @@ -21,15 +21,15 @@ use rustc_hash::{FxHashMap, FxHashSet}; use crate::{context::LintContext, rule::Rule, AstNode}; fn no_fallthrough_case_diagnostic(span: Span) -> OxcDiagnostic { - OxcDiagnostic::error("Expected a 'break' statement before 'case'.").with_label(span) + OxcDiagnostic::warn("Expected a 'break' statement before 'case'.").with_label(span) } fn no_fallthrough_default_diagnostic(span: Span) -> OxcDiagnostic { - OxcDiagnostic::error("Expected a 'break' statement before 'default'.").with_label(span) + OxcDiagnostic::warn("Expected a 'break' statement before 'default'.").with_label(span) } fn no_unused_fallthrough_diagnostic(span: Span) -> OxcDiagnostic { - OxcDiagnostic::error( + OxcDiagnostic::warn( "Found a comment that would permit fallthrough, but case cannot fall through.", ) .with_label(span) diff --git a/crates/oxc_linter/src/rules/eslint/no_unreachable.rs b/crates/oxc_linter/src/rules/eslint/no_unreachable.rs index da6f5f268..839bb714a 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unreachable.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unreachable.rs @@ -13,7 +13,7 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule}; fn no_unreachable_diagnostic(span: Span) -> OxcDiagnostic { - OxcDiagnostic::error("Unreachable code.").with_label(span) + OxcDiagnostic::warn("Unreachable code.").with_label(span) } /// diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_vars/diagnostic.rs b/crates/oxc_linter/src/rules/eslint/no_unused_vars/diagnostic.rs index 0a1c0e5b9..95990c749 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_vars/diagnostic.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_vars/diagnostic.rs @@ -44,7 +44,7 @@ pub fn declared(symbol: &Symbol<'_, '_>) -> OxcDiagnostic { let pronoun = pronoun_for_symbol(symbol.flags()); let name = symbol.name(); - OxcDiagnostic::error(format!("{pronoun} '{name}' is {verb} but never used.")) + OxcDiagnostic::warn(format!("{pronoun} '{name}' is {verb} but never used.")) .with_label(symbol.span().label(format!("'{name}' is declared here"))) .with_help(help) } @@ -54,7 +54,7 @@ pub fn assign(symbol: &Symbol<'_, '_>, assign_span: Span) -> OxcDiagnostic { let pronoun = pronoun_for_symbol(symbol.flags()); let name = symbol.name(); - OxcDiagnostic::error(format!("{pronoun} '{name}' is assigned a value but never used.")) + OxcDiagnostic::warn(format!("{pronoun} '{name}' is assigned a value but never used.")) .with_labels([ symbol.span().label(format!("'{name}' is declared here")), assign_span.label("it was last assigned here"), @@ -66,7 +66,7 @@ pub fn assign(symbol: &Symbol<'_, '_>, assign_span: Span) -> OxcDiagnostic { pub fn param(symbol: &Symbol<'_, '_>) -> OxcDiagnostic { let name = symbol.name(); - OxcDiagnostic::error(format!("Parameter '{name}' is declared but never used.")) + OxcDiagnostic::warn(format!("Parameter '{name}' is declared but never used.")) .with_label(symbol.span().label(format!("'{name}' is declared here"))) .with_help("Consider removing this parameter.") } @@ -76,7 +76,7 @@ pub fn imported(symbol: &Symbol<'_, '_>) -> OxcDiagnostic { let pronoun = pronoun_for_symbol(symbol.flags()); let name = symbol.name(); - OxcDiagnostic::error(format!("{pronoun} '{name}' is imported but never used.")) + OxcDiagnostic::warn(format!("{pronoun} '{name}' is imported but never used.")) .with_label(symbol.span().label(format!("'{name}' is imported here"))) .with_help("Consider removing this import.") }