File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -736,7 +736,12 @@ impl RuleRunner for crate::rules::eslint::no_unreachable::NoUnreachable {
736736}
737737
738738impl RuleRunner for crate :: rules:: eslint:: no_unsafe_finally:: NoUnsafeFinally {
739- const NODE_TYPES : Option < & AstTypesBitset > = None ;
739+ const NODE_TYPES : Option < & AstTypesBitset > = Some ( & AstTypesBitset :: from_types ( & [
740+ AstType :: BreakStatement ,
741+ AstType :: ContinueStatement ,
742+ AstType :: ReturnStatement ,
743+ AstType :: ThrowStatement ,
744+ ] ) ) ;
740745 const RUN_FUNCTIONS : RuleRunFunctionsImplemented = RuleRunFunctionsImplemented :: Run ;
741746}
742747
Original file line number Diff line number Diff line change @@ -51,9 +51,7 @@ declare_oxc_lint!(
5151
5252impl Rule for NoUnsafeFinally {
5353 fn run < ' a > ( & self , node : & AstNode < ' a > , ctx : & LintContext < ' a > ) {
54- let kind = node. kind ( ) ;
55-
56- let sentinel_node_type = match kind {
54+ let sentinel_node_type = match node. kind ( ) {
5755 AstKind :: BreakStatement ( stmt) if stmt. label . is_none ( ) => SentinelNodeType :: Break ,
5856 AstKind :: ContinueStatement ( _) => SentinelNodeType :: Continue ,
5957 AstKind :: ReturnStatement ( _)
@@ -62,7 +60,7 @@ impl Rule for NoUnsafeFinally {
6260 _ => return ,
6361 } ;
6462
65- let label_name = match kind {
63+ let label_name = match node . kind ( ) {
6664 AstKind :: BreakStatement ( BreakStatement { label, .. } )
6765 | AstKind :: ContinueStatement ( ContinueStatement { label, .. } ) => {
6866 label. as_ref ( ) . map ( |label| & label. name )
You can’t perform that action at this time.
0 commit comments