File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
crates/oxc_linter/src/rules/react Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 11use std:: hash:: Hash ;
22
33use itertools:: Itertools ;
4- use phf:: phf_set;
54use rustc_hash:: FxHashSet ;
65
76use oxc_ast:: {
@@ -194,8 +193,7 @@ declare_oxc_lint!(
194193 nursery
195194) ;
196195
197- const HOOKS_USELESS_WITHOUT_DEPENDENCIES : phf:: Set < & ' static str > =
198- phf_set ! ( "useCallback" , "useMemo" ) ;
196+ const HOOKS_USELESS_WITHOUT_DEPENDENCIES : [ & str ; 2 ] = [ "useCallback" , "useMemo" ] ;
199197
200198impl Rule for ExhaustiveDeps {
201199 fn run < ' a > ( & self , node : & AstNode < ' a > , ctx : & LintContext < ' a > ) {
@@ -227,7 +225,7 @@ impl Rule for ExhaustiveDeps {
227225 let is_effect = hook_name. as_str ( ) . contains ( "Effect" ) ;
228226
229227 if dependencies_node. is_none ( ) && !is_effect {
230- if HOOKS_USELESS_WITHOUT_DEPENDENCIES . contains ( hook_name. as_str ( ) ) {
228+ if HOOKS_USELESS_WITHOUT_DEPENDENCIES . contains ( & hook_name. as_str ( ) ) {
231229 ctx. diagnostic ( dependency_array_required_diagnostic (
232230 hook_name. as_str ( ) ,
233231 call_expr. span ( ) ,
You can’t perform that action at this time.
0 commit comments