Skip to content

Commit fd9da94

Browse files
committed
perf(linter): update no-extra-non-null-assertion to use diverging match
1 parent acf5f00 commit fd9da94

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

crates/oxc_linter/src/generated/rule_runner_impls.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2571,7 +2571,12 @@ impl RuleRunner for crate::rules::typescript::no_explicit_any::NoExplicitAny {
25712571
}
25722572

25732573
impl RuleRunner for crate::rules::typescript::no_extra_non_null_assertion::NoExtraNonNullAssertion {
2574-
const NODE_TYPES: Option<&AstTypesBitset> = None;
2574+
const NODE_TYPES: Option<&AstTypesBitset> = Some(&AstTypesBitset::from_types(&[
2575+
AstType::CallExpression,
2576+
AstType::ComputedMemberExpression,
2577+
AstType::StaticMemberExpression,
2578+
AstType::TSNonNullExpression,
2579+
]));
25752580
const RUN_FUNCTIONS: RuleRunFunctionsImplemented = RuleRunFunctionsImplemented::Run;
25762581
}
25772582

crates/oxc_linter/src/rules/typescript/no_extra_non_null_assertion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl Rule for NoExtraNonNullAssertion {
101101
None
102102
}
103103
}
104-
_ => None,
104+
_ => return,
105105
};
106106

107107
if let Some(expr) = expr {

0 commit comments

Comments
 (0)