156 return void 0
157 }
158 form.setFieldValue('communityFocus', unique([...selectedCurr, ...childIds]))
159 return void 0160 },
161 [communities, form, getChildIds, selectedChildren, selectedCurr]
162 )
153 'communityFocus',
154 selectedCurr.filter((id) => !childIds.includes(id))
155 )
156 return void 0157 }
158 form.setFieldValue('communityFocus', unique([...selectedCurr, ...childIds]))
159 return void 0
144 (parentId: string) => {
145 const parentRecord = communities.find(({ id }) => id === parentId)
146 if (!parentRecord) {
147 return void 0148 }
149 const childIds = getChildIds(parentId)
150 if (selectedChildren(parentId, true)) {
322 },
323 })
324 setLoading(false)
325 return void 0326 // eslint-disable-next-line react-hooks/exhaustive-deps
327 }, [locationResult])
328
313 DEFAULT_UNIT,
314 ])
315 if (!params.success) {
316 return void 0317 }
318 router.push({
319 pathname: '/search/[...params]',
A return;
statement with nothing after it is redundant, and has no effect on the runtime behavior of a function.
This can be confusing, so it's better to disallow these redundant statements.
function foo() { return; }
function foo() {
doSomething();
return;
}
function foo() {
if (condition) {
bar();
return;
} else {
baz();
}
}
function foo() {
switch (bar) {
case 1:
doSomething();
default:
doSomethingElse();
return;
}
}
function foo() { return 5; }
function foo() {
return doSomething();
}
function foo() {
if (condition) {
bar();
return;
} else {
baz();
}
qux();
}
function foo() {
switch (bar) {
case 1:
doSomething();
return;
default:
doSomethingElse();
}
}
function foo() {
for (const foo of bar) {
return;
}
}