You have no-unused-vars set in your eslint profile to 'args': 'after-used'. That's not always good because it forces a callback to forgo arguments if it's not using them...
view.model.login.call(view.model, {
error: function (model, xhr, options) {
// only use model, xhr
}
}
If it only uses model (the first argument), that means it has to look like this..
view.model.login.call(view.model, {
error: function (model) {
// only use model
}
}
Which means finding out the order of subsequent arguments means you have to look it up. It also means the signature of the function is in some cases forced to not-match the invocation as in the case where you provide a callback, and the callback is always invoked with three whether or not you need those arguments (as is the case above). This really kills a clean form of code-documentation.
My suggestion is to go from
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}]
to
"no-unused-vars": [2, {"vars": "all", "args": "none"}]
You have
no-unused-varsset in your eslint profile to'args': 'after-used'. That's not always good because it forces a callback to forgo arguments if it's not using them...If it only uses
model(the first argument), that means it has to look like this..Which means finding out the order of subsequent arguments means you have to look it up. It also means the signature of the function is in some cases forced to not-match the invocation as in the case where you provide a callback, and the callback is always invoked with three whether or not you need those arguments (as is the case above). This really kills a clean form of code-documentation.
My suggestion is to go from
to