Skip to content

Commit bad5376

Browse files
committed
perf(linter/no-unwanted-polyfillio): should run when source type is jsx
1 parent 27b4f36 commit bad5376

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/oxc_linter/src/rules/nextjs/no_unwanted_polyfillio.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ declare_oxc_lint!(
4848
);
4949

5050
impl Rule for NoUnwantedPolyfillio {
51+
fn should_run(&self, ctx: &crate::context::ContextHost) -> bool {
52+
ctx.source_type().is_jsx()
53+
}
54+
5155
fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) {
5256
let AstKind::JSXOpeningElement(jsx_el) = node.kind() else {
5357
return;

0 commit comments

Comments
 (0)