Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new rule handle-done-callback #15

Merged
merged 5 commits into from
Jun 23, 2015
Merged

Add new rule handle-done-callback #15

merged 5 commits into from
Jun 23, 2015

Conversation

lo1tuma
Copy link
Owner

@lo1tuma lo1tuma commented Jun 20, 2015

For now the rule performs a really simple check and may not cover each
possible use-case.

  • It doesn’t include branch-tracking to make sure that the done callback is called in every possible branch.
  • It doesn’t check HOW the callback is handled, so e.g. return done; would be sufficient.

For now the rule performs a really simple check and may not cover each
possible use-case.

* It doesn’t include branch-tracking to make sure that the done callback is callend in every possible branch
* It doesn’t check HOW the callback is handled, so e.g. `return done;` would be sufficient.
it('should work', function (done) {
fetchData(options, function (error, data) {
expect(error).not.to.be.ok;
expect(data).to.deep.equal({ foo: 'bar' });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add a comment below this line like // The done callback was not called to make this even more clear.

@lxanders
Copy link
Collaborator

I really like this rule 👍! It seems to work and everything looks fine (apart from my small comments).

@lo1tuma
Copy link
Owner Author

lo1tuma commented Jun 21, 2015

Comments addressed 😉.

I think the two points I mentioned in the PR description could be done in the future (we should file an issue for each). Maybe a generic branch-tracking approach will be implemented directly in ESlint.

lxanders pushed a commit that referenced this pull request Jun 23, 2015
Add new rule handle-done-callback
@lxanders lxanders merged commit 6397a26 into master Jun 23, 2015
@lxanders lxanders deleted the handle-done-callback branch June 23, 2015 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants