mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(linter): add style category and change no-empty-interface to style
It's officially change in typescript-eslint
This commit is contained in:
parent
ad51157ea9
commit
1bc564eafc
3 changed files with 7 additions and 2 deletions
|
|
@ -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"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ declare_oxc_lint!(
|
|||
/// interface Bar extends Foo {}
|
||||
/// ```
|
||||
NoEmptyInterface,
|
||||
correctness
|
||||
style
|
||||
);
|
||||
|
||||
impl Rule for NoEmptyInterface {
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue