File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
oxc_linter/src/rules/react Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -590,9 +590,6 @@ impl Rule for ExhaustiveDeps {
590590
591591 // effects are allowed to have extra dependencies
592592 if !is_effect {
593- let unnecessary_deps: Vec < _ > =
594- declared_dependencies. difference ( & found_dependencies) . collect ( ) ;
595-
596593 // lastly, we need co compare for any unnecessary deps
597594 // for example if `props.foo`, AND `props.foo.bar.baz` was declared in the deps array
598595 // `props.foo.bar.baz` is unnecessary (already covered by `props.foo`)
@@ -612,7 +609,7 @@ impl Rule for ExhaustiveDeps {
612609 }
613610 } ) ;
614611
615- for dep in unnecessary_deps {
612+ for dep in declared_dependencies . difference ( & found_dependencies ) {
616613 if found_dependencies. iter ( ) . any ( |found_dep| found_dep. contains ( dep) ) {
617614 continue ;
618615 }
Original file line number Diff line number Diff line change @@ -139,15 +139,16 @@ fn main() -> std::io::Result<()> {
139139 } ,
140140 & |_graph, node| {
141141 let nodes = ast_nodes_by_block. get( node. 1 ) . map_or( "None" . to_string( ) , |nodes| {
142- let nodes: Vec <_> =
143- nodes. iter( ) . map( |node| format!( "{}" , node. kind( ) . debug_name( ) ) ) . collect( ) ;
144142 if nodes. len( ) > 1 {
145143 format!(
146144 "{}\\ l" ,
147- nodes. into_iter( ) . map( |it| format!( "\\ l {it}" ) ) . join( "" )
145+ nodes
146+ . iter( )
147+ . map( |node| format!( "\\ l {}" , node. kind( ) . debug_name( ) ) )
148+ . join( "" )
148149 )
149150 } else {
150- nodes. into_iter ( ) . join( "" )
151+ nodes. iter ( ) . map ( |node| format! ( "{}" , node . kind ( ) . debug_name ( ) ) ) . join( "" )
151152 }
152153 } ) ;
153154 format!(
You can’t perform that action at this time.
0 commit comments