Skip to content

Commit 11b055e

Browse files
committed
perf(linter): no-unused-private-class-members: only run when there are any classes (#14869)
Same story as #14865. Initial codspeed benchmark showed an anomalously large drop, though I'm not sure why. I'd expect a measurable but very small improvement.
1 parent 5493278 commit 11b055e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ impl Rule for NoUnusedPrivateClassMembers {
111111
}
112112
});
113113
}
114+
115+
fn should_run(&self, ctx: &crate::context::ContextHost) -> bool {
116+
ctx.semantic().classes().len() > 0
117+
}
114118
}
115119

116120
fn is_read(current_node_id: NodeId, semantic: &Semantic) -> bool {

0 commit comments

Comments
 (0)