diff --git a/crates/oxc_linter/src/rule.rs b/crates/oxc_linter/src/rule.rs index 4d739eafdb4c6..82d169f7061a7 100644 --- a/crates/oxc_linter/src/rule.rs +++ b/crates/oxc_linter/src/rule.rs @@ -39,6 +39,8 @@ pub enum RuleCategory { Suspicious, /// Lints which are rather strict or have occasional false positives Pedantic, + /// Code that can be written to run faster + Perf, /// Code that should be written in a more idiomatic way Style, /// Lints which prevent the use of language and library features @@ -57,6 +59,7 @@ impl RuleCategory { "correctness" => Some(Self::Correctness), "suspicious" => Some(Self::Suspicious), "pedantic" => Some(Self::Pedantic), + "perf" => Some(Self::Perf), "style" => Some(Self::Style), "restriction" => Some(Self::Restriction), "nursery" => Some(Self::Nursery), @@ -71,6 +74,7 @@ impl fmt::Display for RuleCategory { Self::Correctness => write!(f, "Correctness"), Self::Suspicious => write!(f, "Suspicious"), Self::Pedantic => write!(f, "Pedantic"), + Self::Perf => write!(f, "Perf"), Self::Style => write!(f, "Style"), Self::Restriction => write!(f, "Restriction"), Self::Nursery => write!(f, "Nursery"), diff --git a/crates/oxc_macros/src/declare_oxc_lint.rs b/crates/oxc_macros/src/declare_oxc_lint.rs index 16ee835bdf986..86cff10d0bffc 100644 --- a/crates/oxc_macros/src/declare_oxc_lint.rs +++ b/crates/oxc_macros/src/declare_oxc_lint.rs @@ -48,6 +48,7 @@ pub fn declare_oxc_lint(metadata: LintRuleMeta) -> TokenStream { "correctness" => quote! { RuleCategory::Correctness }, "suspicious" => quote! { RuleCategory::Suspicious }, "pedantic" => quote! { RuleCategory::Pedantic }, + "perf" => quote! { RuleCategory::Perf }, "style" => quote! { RuleCategory::Style }, "restriction" => quote! { RuleCategory::Restriction }, "nursery" => quote! { RuleCategory::Nursery },