File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
crates/oxc_linter/src/rules/eslint Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -68,19 +68,19 @@ declare_oxc_lint!(
6868
6969impl Rule for NoFuncAssign {
7070 fn run < ' a > ( & self , node : & AstNode < ' a > , ctx : & LintContext < ' a > ) {
71- if let AstKind :: Function ( func) = node. kind ( ) {
72- let ( func_name , symbol_id ) = match & func . id {
73- Some ( id ) => ( id . name . as_str ( ) , id . symbol_id ( ) ) ,
74- None => return ,
75- } ;
76- let symbol_table = ctx . scoping ( ) ;
77- for reference in symbol_table . get_resolved_references ( symbol_id ) {
78- if reference . is_write ( ) {
79- ctx . diagnostic ( no_func_assign_diagnostic (
80- func_name ,
81- ctx . semantic ( ) . reference_span ( reference ) ,
82- ) ) ;
83- }
71+ let AstKind :: Function ( func) = node. kind ( ) else { return } ;
72+
73+ let ( func_name , symbol_id ) = match & func . id {
74+ Some ( id ) => ( id . name . as_str ( ) , id . symbol_id ( ) ) ,
75+ None => return ,
76+ } ;
77+ let symbol_table = ctx . scoping ( ) ;
78+ for reference in symbol_table . get_resolved_references ( symbol_id ) {
79+ if reference . is_write ( ) {
80+ ctx . diagnostic ( no_func_assign_diagnostic (
81+ func_name ,
82+ ctx . semantic ( ) . reference_span ( reference ) ,
83+ ) ) ;
8484 }
8585 }
8686 }
You can’t perform that action at this time.
0 commit comments