Skip to content

Commit 5d45d81

Browse files
committed
Disable ESLint error
ESLint reports that this function doesn't have a `return` statement, but it does. It's possible ESLint thinks the switch might not be exhaustive, but it is and TypeScript is able to verify this. Therefore it may be an issue with the integration between TS and ESLint.
1 parent ed40a01 commit 5d45d81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,10 @@ const Body = (props: {
516516
element._type !==
517517
'model.dotcomrendering.pageElements.AdPlaceholderBlockElement',
518518
)
519+
/* eslint-disable-next-line array-callback-return -- ESLint bug,
520+
* this function does contain `return` statements. TypeScript will
521+
* confirm the switch is exhaustive, but it's possible ESLint does
522+
* not know this. */
519523
.map((element, index) => {
520524
switch (element._type) {
521525
case 'model.dotcomrendering.pageElements.ImageBlockElement':

0 commit comments

Comments
 (0)