[英]Eslint no-return-assing and no-param-reassign error
const someId = data.id;
values.some_id = someId;
values.updateParams.map(
params => params.some_another_id = someId,
);
In the above code, eslint is throwing some error and won't be able to understand those.在上面的代码中,eslint 抛出了一些错误并且无法理解这些错误。 Here I added the screenshots of the error.
这里我添加了错误的截图。
const someId = data.id;
values.some_id = someId;
values.updateParams.map(
params => ({ ...params, serviceable_port_pair_id: someId,})
);
you are supposed to return the Object, how it should look like, but not mutate the parameter inside the arrow function你应该返回对象,它应该是什么样子,但不要改变箭头函数内的参数
and for the first error message.以及第一条错误信息。 The insutructions couldnt be clearer.
说明再清楚不过了。 You shouldnt reassign already defined params
你不应该重新分配已经定义的参数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.