perf(linter/react): add should_run conditions for react rules (#5402)

This commit is contained in:
Jelle van der Waa 2024-09-04 14:37:15 +02:00 committed by GitHub
parent f89c776ac4
commit 81709549d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -147,6 +147,10 @@ impl Rule for JsxBooleanValue {
}
}
}
fn should_run(&self, ctx: &LintContext) -> bool {
ctx.source_type().is_jsx()
}
}
impl JsxBooleanValue {

View file

@ -120,6 +120,10 @@ impl Rule for JsxPropsNoSpreadMulti {
);
}
}
fn should_run(&self, ctx: &LintContext) -> bool {
ctx.source_type().is_jsx()
}
}
#[test]