Prevent useless assignment of the form:
var foo = bar;
return foo;
var foo;
// ...
foo = bar;
return foo;
npm i --save-dev eslint-plugin-no-useless-assign
{
"plugins": [
"no-useless-assign"
],
"rules": {
"no-useless-assign/no-useless-assign": 2
}
}