@@ -173,34 +173,35 @@ impl Rule for RequireHook {
173173 }
174174
175175 fn run < ' a > ( & self , node : & AstNode < ' a > , ctx : & LintContext < ' a > ) {
176- let kind = node. kind ( ) ;
177-
178- if let AstKind :: Program ( program) = kind {
179- self . check_block_body ( node, & program. body , ctx) ;
180- } else if let AstKind :: CallExpression ( call_expr) = kind {
181- if !is_type_of_jest_fn_call (
182- call_expr,
183- & PossibleJestNode { node, original : None } ,
184- ctx,
185- & [ JestFnKind :: General ( JestGeneralFnKind :: Describe ) ] ,
186- ) || call_expr. arguments . len ( ) < 2
187- {
188- return ;
176+ match node. kind ( ) {
177+ AstKind :: Program ( program) => {
178+ self . check_block_body ( node, & program. body , ctx) ;
189179 }
190-
191- match & call_expr. arguments [ 1 ] {
192- Argument :: FunctionExpression ( func_expr) => {
193- if let Some ( func_body) = & func_expr. body {
194- self . check_block_body ( node, & func_body. statements , ctx) ;
195- }
180+ AstKind :: CallExpression ( call_expr) => {
181+ if !is_type_of_jest_fn_call (
182+ call_expr,
183+ & PossibleJestNode { node, original : None } ,
184+ ctx,
185+ & [ JestFnKind :: General ( JestGeneralFnKind :: Describe ) ] ,
186+ ) || call_expr. arguments . len ( ) < 2
187+ {
188+ return ;
196189 }
197- Argument :: ArrowFunctionExpression ( arrow_func_expr) => {
198- if !arrow_func_expr. expression {
199- self . check_block_body ( node, & arrow_func_expr. body . statements , ctx) ;
190+ match & call_expr. arguments [ 1 ] {
191+ Argument :: FunctionExpression ( func_expr) => {
192+ if let Some ( func_body) = & func_expr. body {
193+ self . check_block_body ( node, & func_body. statements , ctx) ;
194+ }
195+ }
196+ Argument :: ArrowFunctionExpression ( arrow_func_expr) => {
197+ if !arrow_func_expr. expression {
198+ self . check_block_body ( node, & arrow_func_expr. body . statements , ctx) ;
199+ }
200200 }
201+ _ => ( ) ,
201202 }
202- _ => ( ) ,
203203 }
204+ _ => { }
204205 }
205206 }
206207}
0 commit comments