diff --git a/crates/oxc_linter/src/rule.rs b/crates/oxc_linter/src/rule.rs index f2a23ecf1..ad53f317b 100644 --- a/crates/oxc_linter/src/rule.rs +++ b/crates/oxc_linter/src/rule.rs @@ -37,8 +37,10 @@ pub enum RuleCategory { Correctness, /// Code that is most likely wrong or useless Suspicious, - /// Pedantic + /// Lints which are rather strict or have occasional false positives Pedantic, + /// Code that should be written in a more idiomatic way + Style, /// Lints which prevent the use of language and library features /// The restriction category should, emphatically, not be enabled as a whole. /// The contained lints may lint against perfectly reasonable code, may not have an alternative suggestion, @@ -55,6 +57,7 @@ impl RuleCategory { "correctness" => Some(Self::Correctness), "suspicious" => Some(Self::Suspicious), "pedantic" => Some(Self::Pedantic), + "style" => Some(Self::Style), "restriction" => Some(Self::Restriction), "nursery" => Some(Self::Nursery), _ => None, @@ -68,6 +71,7 @@ impl fmt::Display for RuleCategory { Self::Correctness => write!(f, "Correctness"), Self::Suspicious => write!(f, "Suspicious"), Self::Pedantic => write!(f, "Pedantic"), + Self::Style => write!(f, "Style"), Self::Restriction => write!(f, "Restriction"), Self::Nursery => write!(f, "Nursery"), } diff --git a/crates/oxc_linter/src/rules/typescript/no_empty_interface.rs b/crates/oxc_linter/src/rules/typescript/no_empty_interface.rs index 054100f1e..6cfc14d91 100644 --- a/crates/oxc_linter/src/rules/typescript/no_empty_interface.rs +++ b/crates/oxc_linter/src/rules/typescript/no_empty_interface.rs @@ -40,7 +40,7 @@ declare_oxc_lint!( /// interface Bar extends Foo {} /// ``` NoEmptyInterface, - correctness + style ); impl Rule for NoEmptyInterface { diff --git a/crates/oxc_macros/src/declare_oxc_lint.rs b/crates/oxc_macros/src/declare_oxc_lint.rs index c42517676..5aec3a872 100644 --- a/crates/oxc_macros/src/declare_oxc_lint.rs +++ b/crates/oxc_macros/src/declare_oxc_lint.rs @@ -62,6 +62,7 @@ pub fn declare_oxc_lint(metadata: LintRuleMeta) -> TokenStream { "correctness" => quote! { RuleCategory::Correctness }, "suspicious" => quote! { RuleCategory::Suspicious }, "pedantic" => quote! { RuleCategory::Pedantic }, + "style" => quote! { RuleCategory::Style }, "restriction" => quote! { RuleCategory::Restriction }, "nursery" => quote! { RuleCategory::Nursery }, _ => panic!("invalid rule category"),