File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
packages/eslint-plugin-react-hooks/src Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,7 @@ export default {
49
49
: undefined ;
50
50
51
51
const avoidObjects =
52
- context . options &&
53
- context . options [ 0 ] &&
54
- context . options [ 0 ] . avoidObjects ;
52
+ context . options && context . options [ 0 ] && context . options [ 0 ] . avoidObjects ;
55
53
56
54
const enableDangerousAutofixThisMayCauseInfiniteLoops =
57
55
( context . options &&
@@ -632,7 +630,11 @@ export default {
632
630
return ;
633
631
}
634
632
// If we see an object then add a special warning if the avoidObjects option is true.
635
- if ( declaredDependencyNode . type === 'Identifier' && options && options . avoidObjects ) {
633
+ if (
634
+ declaredDependencyNode . type === 'Identifier' &&
635
+ options &&
636
+ options . avoidObjects
637
+ ) {
636
638
reportProblem ( {
637
639
node : declaredDependencyNode ,
638
640
message :
Original file line number Diff line number Diff line change @@ -15,9 +15,12 @@ export const configs = {
15
15
plugins : [ 'react-hooks' ] ,
16
16
rules : {
17
17
'react-hooks/rules-of-hooks' : 'error' ,
18
- 'react-hooks/exhaustive-deps' : [ 'warn' , {
19
- 'avoidObjects' : true ,
20
- } ] ,
18
+ 'react-hooks/exhaustive-deps' : [
19
+ 'warn' ,
20
+ {
21
+ avoidObjects : true ,
22
+ } ,
23
+ ] ,
21
24
} ,
22
25
} ,
23
26
} ;
You can’t perform that action at this time.
0 commit comments