Skip to content

Commit

Permalink
perf(linter/react): add should_run conditions for react rules (#5402)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly authored Sep 4, 2024
1 parent f89c776 commit 8170954
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/oxc_linter/src/rules/react/jsx_boolean_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ impl Rule for JsxBooleanValue {
}
}
}

fn should_run(&self, ctx: &LintContext) -> bool {
ctx.source_type().is_jsx()
}
}

impl JsxBooleanValue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ impl Rule for JsxPropsNoSpreadMulti {
);
}
}

fn should_run(&self, ctx: &LintContext) -> bool {
ctx.source_type().is_jsx()
}
}

#[test]
Expand Down

0 comments on commit 8170954

Please sign in to comment.