Skip to content

Commit 93c52ad

Browse files
authored
chore: add eslint arrow-body-style config (#205)
1 parent dd5d368 commit 93c52ad

File tree

3 files changed

+31
-38
lines changed

3 files changed

+31
-38
lines changed

Diff for: .eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
jest: true,
2323
},
2424
rules: {
25+
'arrow-body-style': ['error', 'as-needed'],
2526
curly: 'error',
2627

2728
// I'll probably add some typescript types instead

Diff for: src/components/ResultQueries.js

+29-35
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,24 @@ function ResultQueries({ data, possibleQueries, dispatch, activeMethod }) {
5050
<Heading>1. Queries Accessible to Everyone</Heading>
5151
{queries
5252
.filter((query) => query.type === 'ACCESSIBLE')
53-
.map((query) => {
54-
return (
53+
.map((query) => (
54+
<Field
55+
key={query.method}
56+
data={data}
57+
method={query.method}
58+
query={possibleQueries[query.method]}
59+
dispatch={dispatch}
60+
active={query.method === activeMethod}
61+
/>
62+
))}
63+
</Section>
64+
65+
<div className="space-y-8">
66+
<Section>
67+
<Heading>2. Semantic Queries</Heading>
68+
{queries
69+
.filter((query) => query.type === 'SEMANTIC')
70+
.map((query) => (
5571
<Field
5672
key={query.method}
5773
data={data}
@@ -60,45 +76,23 @@ function ResultQueries({ data, possibleQueries, dispatch, activeMethod }) {
6076
dispatch={dispatch}
6177
active={query.method === activeMethod}
6278
/>
63-
);
64-
})}
65-
</Section>
66-
67-
<div className="space-y-8">
68-
<Section>
69-
<Heading>2. Semantic Queries</Heading>
70-
{queries
71-
.filter((query) => query.type === 'SEMANTIC')
72-
.map((query) => {
73-
return (
74-
<Field
75-
key={query.method}
76-
data={data}
77-
method={query.method}
78-
query={possibleQueries[query.method]}
79-
dispatch={dispatch}
80-
active={query.method === activeMethod}
81-
/>
82-
);
83-
})}
79+
))}
8480
</Section>
8581

8682
<Section>
8783
<Heading>3. TestId</Heading>
8884
{queries
8985
.filter((query) => query.type === 'TEST')
90-
.map((query) => {
91-
return (
92-
<Field
93-
key={query.method}
94-
data={data}
95-
method={query.method}
96-
query={possibleQueries[query.method]}
97-
dispatch={dispatch}
98-
active={query.method === activeMethod}
99-
/>
100-
);
101-
})}
86+
.map((query) => (
87+
<Field
88+
key={query.method}
89+
data={data}
90+
method={query.method}
91+
query={possibleQueries[query.method]}
92+
dispatch={dispatch}
93+
active={query.method === activeMethod}
94+
/>
95+
))}
10296
</Section>
10397
</div>
10498
</div>

Diff for: tests/setupTests.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ if (window.document) {
66
window.document.createRange = () => ({
77
setStart: () => {},
88
setEnd: () => {},
9-
getBoundingClientRect: () => {
10-
return { right: 0 };
11-
},
9+
getBoundingClientRect: () => ({ right: 0 }),
1210
getClientRects: () => [],
1311
});
1412
}

0 commit comments

Comments
 (0)