I have this code:
const subTotal = orderInfo.details.reduce((acc, cv) => acc += Number(cv.price) * Number(cv.quantity), 0);
I want to disable two ESLint types of checks for this line, no-return-assign and no-param-reassign.
I tried it this way:
/* eslint-disable-next-line no-return-assign eslint-disable-next-line no-param-reassign */
const subTotal = orderInfo.details.reduce((acc, cv) => acc += Number(cv.price) * Number(cv.quantity), 0);
But my editor is still showing the eslint(no-return-assign) lint error.
=> acc + ...? Then you don't break the rules anyway. There's no need for the assignment.