Skip to content

Commit 9ee3892

Browse files
fix: resolve eslint errors
1 parent 29c2dc1 commit 9ee3892

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

src/optimizer-page/scan-results/ScanResults.tsx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ const ScanResults: FC<Props> = ({ data }) => {
133133

134134
// Calculate if there are any previous run links across all sections
135135
const hasPreviousRunLinks = useMemo(
136-
// eslint-disable-next-line max-len
137-
() => allSectionsForPrevRun.some(section => section.subsections.some(subsection => subsection.units.some(unit => unit.blocks.some(block => block.previousRunLinks && block.previousRunLinks.length > 0)))),
136+
() => allSectionsForPrevRun.some(section => (
137+
section.subsections.some(subsection => subsection.units.some(unit => (
138+
unit.blocks.some(block => block.previousRunLinks && block.previousRunLinks.length > 0)
139+
))))),
138140
[allSectionsForPrevRun],
139141
);
140142

@@ -182,27 +184,28 @@ const ScanResults: FC<Props> = ({ data }) => {
182184
// Only show sections that have at least one unit with a visible link (not just previousRunLinks)
183185
const shouldSectionRender = (sectionIndex: number): boolean => {
184186
const section = allSectionsForBrokenLinks[sectionIndex];
185-
// eslint-disable-next-line max-len
186-
const hasVisibleUnit = section.subsections.some((subsection) => subsection.units.some((unit) => unit.blocks.some((block) => {
187-
const hasBroken = block.brokenLinks?.length > 0;
188-
const hasLocked = block.lockedLinks?.length > 0;
189-
const hasExternal = block.externalForbiddenLinks?.length > 0;
187+
const hasVisibleUnit = section.subsections.some(
188+
(subsection) => subsection.units.some((unit) => unit.blocks.some((block) => {
189+
const hasBroken = block.brokenLinks?.length > 0;
190+
const hasLocked = block.lockedLinks?.length > 0;
191+
const hasExternal = block.externalForbiddenLinks?.length > 0;
190192

191-
const noFilters = !filters.brokenLinks
193+
const noFilters = !filters.brokenLinks
192194
&& !filters.lockedLinks
193195
&& !filters.externalForbiddenLinks;
194196

195-
const showBroken = filters.brokenLinks && hasBroken;
196-
const showLocked = filters.lockedLinks && hasLocked;
197-
const showExternal = filters.externalForbiddenLinks && hasExternal;
197+
const showBroken = filters.brokenLinks && hasBroken;
198+
const showLocked = filters.lockedLinks && hasLocked;
199+
const showExternal = filters.externalForbiddenLinks && hasExternal;
198200

199-
return (
200-
showBroken
201-
|| showLocked
202-
|| showExternal
203-
|| (noFilters && (hasBroken || hasLocked || hasExternal))
204-
);
205-
})));
201+
return (
202+
showBroken
203+
|| showLocked
204+
|| showExternal
205+
|| (noFilters && (hasBroken || hasLocked || hasExternal))
206+
);
207+
})),
208+
);
206209
return hasVisibleUnit;
207210
};
208211

0 commit comments

Comments
 (0)