mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
perf(linter/react): add should_run conditions for react rules (#5402)
This commit is contained in:
parent
f89c776ac4
commit
81709549d9
2 changed files with 8 additions and 0 deletions
|
|
@ -147,6 +147,10 @@ impl Rule for JsxBooleanValue {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn should_run(&self, ctx: &LintContext) -> bool {
|
||||
ctx.source_type().is_jsx()
|
||||
}
|
||||
}
|
||||
|
||||
impl JsxBooleanValue {
|
||||
|
|
|
|||
|
|
@ -120,6 +120,10 @@ impl Rule for JsxPropsNoSpreadMulti {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn should_run(&self, ctx: &LintContext) -> bool {
|
||||
ctx.source_type().is_jsx()
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue