@@ -4,7 +4,6 @@ use oxc_macros::declare_oxc_lint;
4
4
use oxc_semantic:: { NodeId , SymbolId } ;
5
5
use oxc_span:: { GetSpan , Span } ;
6
6
use oxc_syntax:: operator:: UnaryOperator ;
7
- use phf:: phf_set;
8
7
9
8
use crate :: { context:: LintContext , rule:: Rule } ;
10
9
@@ -44,11 +43,11 @@ declare_oxc_lint!(
44
43
correctness
45
44
) ;
46
45
47
- const OBJECT_MUTATION_METHODS : phf :: Set < & ' static str > =
48
- phf_set ! ( "assign" , "defineProperty" , "defineProperties" , "freeze" , "setPrototypeOf" ) ;
46
+ const OBJECT_MUTATION_METHODS : [ & str ; 5 ] =
47
+ [ "assign" , "defineProperty" , "defineProperties" , "freeze" , "setPrototypeOf" ] ;
49
48
50
- const REFLECT_MUTATION_METHODS : phf :: Set < & ' static str > =
51
- phf_set ! ( "defineProperty" , "deleteProperty" , "set" , "setPrototypeOf" ) ;
49
+ const REFLECT_MUTATION_METHODS : [ & str ; 4 ] =
50
+ [ "defineProperty" , "deleteProperty" , "set" , "setPrototypeOf" ] ;
52
51
53
52
impl Rule for NoImportAssign {
54
53
fn run_on_symbol ( & self , symbol_id : SymbolId , ctx : & LintContext < ' _ > ) {
@@ -125,8 +124,8 @@ fn is_argument_of_well_known_mutation_function(node_id: NodeId, ctx: &LintContex
125
124
return false ;
126
125
} ;
127
126
128
- if ( ( ident. name == "Object" && OBJECT_MUTATION_METHODS . contains ( property_name) )
129
- || ( ident. name == "Reflect" && REFLECT_MUTATION_METHODS . contains ( property_name) ) )
127
+ if ( ( ident. name == "Object" && OBJECT_MUTATION_METHODS . contains ( & property_name) )
128
+ || ( ident. name == "Reflect" && REFLECT_MUTATION_METHODS . contains ( & property_name) ) )
130
129
&& !ctx. scoping ( ) . has_binding ( ident. reference_id ( ) )
131
130
{
132
131
return expr
0 commit comments