Skip to content

Commit 08edbed

Browse files
apply prettier suggestions
1 parent 98df102 commit 08edbed

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ export default {
4949
: undefined;
5050

5151
const avoidObjects =
52-
context.options &&
53-
context.options[0] &&
54-
context.options[0].avoidObjects;
52+
context.options && context.options[0] && context.options[0].avoidObjects;
5553

5654
const enableDangerousAutofixThisMayCauseInfiniteLoops =
5755
(context.options &&
@@ -632,7 +630,11 @@ export default {
632630
return;
633631
}
634632
// 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+
) {
636638
reportProblem({
637639
node: declaredDependencyNode,
638640
message:

packages/eslint-plugin-react-hooks/src/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ export const configs = {
1515
plugins: ['react-hooks'],
1616
rules: {
1717
'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+
],
2124
},
2225
},
2326
};

0 commit comments

Comments
 (0)