Skip to content

Commit

Permalink
feat(linter): support eslint/no-unused-private-class-members rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Dec 27, 2023
1 parent de2f834 commit bda795c
Show file tree
Hide file tree
Showing 7 changed files with 655 additions and 15 deletions.
3 changes: 3 additions & 0 deletions crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,9 @@ impl MethodDefinitionKind {
pub fn is_constructor(&self) -> bool {
matches!(self, Self::Constructor)
}
pub fn is_method(&self) -> bool {
matches!(self, Self::Method)
}
}

#[derive(Debug, Clone, Hash)]
Expand Down
2 changes: 2 additions & 0 deletions crates/oxc_linter/src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ mod eslint {
pub mod no_unsafe_negation;
pub mod no_unsafe_optional_chaining;
pub mod no_unused_labels;
pub mod no_unused_private_class_members;
pub mod no_useless_catch;
pub mod no_useless_escape;
pub mod require_yield;
Expand Down Expand Up @@ -319,6 +320,7 @@ oxc_macros::declare_all_lint_rules! {
eslint::no_unsafe_negation,
eslint::no_unsafe_optional_chaining,
eslint::no_unused_labels,
eslint::no_unused_private_class_members,
eslint::no_useless_catch,
eslint::no_useless_escape,
eslint::require_yield,
Expand Down
Loading

0 comments on commit bda795c

Please sign in to comment.