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

Update: callback-return allows for object methods (fixes #4711) #6277

Merged
merged 1 commit into from Jun 3, 2016

Conversation

kaicataldo
Copy link
Member

@kaicataldo kaicataldo commented May 29, 2016

The one caveat about solving this problem this way is that it must match exactly - i.e. object().method is not the same thing as object.method. This seems to me like a reasonable tradeoff to solve this issue right now, though maybe it could be made much smarter in the future. Updated, no longer relevant.

@eslintbot
Copy link

LGTM

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @vitorbal, @nzakas and @gyandeeps to be potential reviewers

@@ -73,7 +74,7 @@ ruleTester.run("callback-return", rule, {

// options (only warns with the correct callback name)
{
code: "if (err) { callback(err) }",
Copy link
Member Author

Choose a reason for hiding this comment

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

This was actually allowing anything to pass because it wasn't wrapped in a function

@nzakas
Copy link
Member

nzakas commented Jun 1, 2016

Can you update the docs to show methods will work?

@kaicataldo kaicataldo force-pushed the fixes4711 branch 5 times, most recently from 5c1d49b to b699c1e Compare June 2, 2016 04:49

Examples of **incorrect** code for this rule with the default `["callback", "cb", "next"]` option:

```js
/*eslint callback-return: "error"*/

function foo() {
function foo(err, callback) {
Copy link
Member Author

Choose a reason for hiding this comment

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

For consistency with the example at the beginning. I think it makes the examples a little more concrete - please let me know if you disagree.

@kaicataldo
Copy link
Member Author

Updated

@eslintbot
Copy link

LGTM

@nzakas
Copy link
Member

nzakas commented Jun 3, 2016

Lgtm

@nzakas nzakas merged commit 72c2ea5 into master Jun 3, 2016
@kaicataldo kaicataldo deleted the fixes4711 branch June 4, 2016 05:33
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants