I have this code
const subTotal = orderInfo.details.reduce((acc, cv) => acc += Number(cv.price) * Number(cv.quantity), 0);
I want to diable two eslint for this line, no-return-assign and no-param-reassign
I tried 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 still showing eslint(no-return-assign) lint error
If you want to disable multiple ESLint errors, you can do the following (note the commas):
// eslint-disable-next-line no-return-assign, no-param-reassign
( your code... )
( your code... ) // eslint-disable-line no-return-assign, no-param-reassign
/* eslint-disable no-return-assign, no-param-reassign */
( your code... )
/* eslint-enable no-return-assign, no-param-reassign */
See the Configuring Rules section of the ESLint documentation.
(Though it might be a better choice to simply disable these errors in your .eslintrc
file if you can't follow certain rules all the time.)