handle-callback-err shouldn't trigger when `arguments` is used
See original GitHub issueWhat rule do you want to change?
handle-callback-err
Does this change cause the rule to produce more or fewer warnings? Fewer.
How will the change be implemented? (New option, new default behavior, etc.)? IMO the default behavior should be changed, maybe an option could be added.
Please provide some example code that this change will affect:
Saw some code trigger this one time that looked something like this: (I can’t find the exact source now…)
something(function (err /* err is ... */) {
this.emit('some-event', arguments)
})
Or at least, something like that.
What does the rule currently do for this code?
It says err
is not handled, but it actually is.
What will the rule do after it’s changed?
See that arguments
was used, and not fail the rule check.
I’d also like it to be able to check for arguments[0]
specifically and not other indexes… if possible.
Are you willing to submit a pull request to implement this change?
Yes, but I am fairly unfamiliar with eslint rule programming so I’m having a hard time figuring out how to do the arguments
check.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
I think creating your own version of the rule is probably your best bet. Take a look at eslint-rule-composer, which should make it easier to just eliminate the warnings you don’t want.
Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.
Thanks for contributing to ESLint and we appreciate your understanding.