Skip to content

Commit e673f22

Browse files
committed
perf(linter): generate node type info for lint rules with let..else
1 parent ce94926 commit e673f22

File tree

3 files changed

+597
-482
lines changed

3 files changed

+597
-482
lines changed

crates/oxc_linter/src/rule.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ mod test {
360360
&eslint::default_case::DefaultCase::default(),
361361
&[SwitchStatement],
362362
);
363+
assert_rule_runs_on_node_types(&eslint::for_direction::ForDirection, &[ForStatement]);
364+
assert_rule_runs_on_node_types(
365+
&eslint::no_useless_constructor::NoUselessConstructor,
366+
&[MethodDefinition],
367+
);
363368
assert_rule_runs_on_node_types(
364369
&import::no_mutable_exports::NoMutableExports,
365370
&[ExportNamedDeclaration, ExportDefaultDeclaration],
@@ -368,10 +373,15 @@ mod test {
368373
&jest::prefer_jest_mocked::PreferJestMocked,
369374
&[TSAsExpression, TSTypeAssertion],
370375
);
376+
assert_rule_runs_on_node_types(
377+
&jest::prefer_called_with::PreferCalledWith,
378+
&[CallExpression],
379+
);
371380
assert_rule_runs_on_node_types(
372381
&jsx_a11y::anchor_is_valid::AnchorIsValid::default(),
373382
&[JSXElement],
374383
);
384+
assert_rule_runs_on_node_types(&jsx_a11y::lang::Lang, &[JSXOpeningElement]);
375385
assert_rule_runs_on_node_types(
376386
&nextjs::no_head_element::NoHeadElement,
377387
&[JSXOpeningElement],
@@ -396,6 +406,10 @@ mod test {
396406
&unicorn::explicit_length_check::ExplicitLengthCheck::default(),
397407
&[StaticMemberExpression],
398408
);
409+
assert_rule_runs_on_node_types(
410+
&unicorn::no_zero_fractions::NoZeroFractions,
411+
&[NumericLiteral],
412+
);
399413
}
400414

401415
fn assert_rule_runs_on_node_types<R: RuleMeta + RuleRunner>(

0 commit comments

Comments
 (0)