From 823a73c70e57634ed1fa923533b6b55d80bb5552 Mon Sep 17 00:00:00 2001 From: camc314 <18101008+camc314@users.noreply.github.com> Date: Sun, 25 Jan 2026 19:42:43 +0000 Subject: [PATCH] style(semantic): reorder diagnostic functions (#18540) just reorders the diagnostic functions so the ts error codes are in numerical order --- crates/oxc_parser/src/diagnostics.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/oxc_parser/src/diagnostics.rs b/crates/oxc_parser/src/diagnostics.rs index 017357ab00de6..2e19472e66e89 100644 --- a/crates/oxc_parser/src/diagnostics.rs +++ b/crates/oxc_parser/src/diagnostics.rs @@ -1132,14 +1132,20 @@ pub fn setter_with_parameters(span: Span, parameters_count: usize) -> OxcDiagnos } #[cold] -pub fn setter_with_rest_parameter(span: Span) -> OxcDiagnostic { - ts_error("1053", "A 'set' accessor cannot have rest parameter.").with_label(span) +pub fn setter_with_optional_parameter(span: Span) -> OxcDiagnostic { + ts_error("1051", "A 'set' accessor cannot have an optional parameter.").with_label(span) } + #[cold] pub fn setter_with_initializer(span: Span) -> OxcDiagnostic { ts_error("1052", "A 'set' accessor cannot have an initializer.").with_label(span) } +#[cold] +pub fn setter_with_rest_parameter(span: Span) -> OxcDiagnostic { + ts_error("1053", "A 'set' accessor cannot have rest parameter.").with_label(span) +} + #[cold] pub fn getter_parameters(span: Span) -> OxcDiagnostic { OxcDiagnostic::error("A 'get' accessor must not have any formal parameters.") @@ -1147,11 +1153,6 @@ pub fn getter_parameters(span: Span) -> OxcDiagnostic { .with_help("Remove these parameters here") } -#[cold] -pub fn setter_with_optional_parameter(span: Span) -> OxcDiagnostic { - ts_error("1051", "A 'set' accessor cannot have an optional parameter.").with_label(span) -} - #[cold] pub fn accessor_cannot_have_this_parameter(span: Span) -> OxcDiagnostic { ts_error("2784", "'get' and 'set' accessors cannot declare 'this' parameters.").with_label(span)