How to fix "Unexpected block statement surrounding arrow body; move the returned value immediately after the =>" ESLint error?

I’m getting this error

Unexpected block statement surrounding arrow body; move the returned value immediately after the =>"

for the code below:

let guestBeingEdited = SJ.Event.ListItem.previouslyAddedGuests.filter(
    guest => {
        return guest.id === SJ.Event.ListItem.selectPrevGuest;
    },
);

I tried different suggestions from here but couldn’t get it fixed. Any suggestions?

5 thoughts on “How to fix "Unexpected block statement surrounding arrow body; move the returned value immediately after the =>" ESLint error?”

Leave a Comment