I did not find a documentation in the whole eslint website, and I do not know if there is a plugin to forbid arguments editions.
Here is an example of code which should be:
Incorrect:
const incorrectUpdate = (data) => {
data.field = data.field === 'Hello' ? 'Stack' : 'Overflow';
return data;
};
Correct:
const validUpdate = (data) => {
return { ...data, field: data.field === 'Hello' ? 'Stack' : 'Overflow' };
};
Please can you send me the eslint config?
Can you left Array.reduce to continue accumulator edition ?