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

Fix: no-unused-vars false positive around callback (fixes #6576) #6579

Merged
merged 2 commits into from Jul 5, 2016

Conversation

mysticatea
Copy link
Member

Fixes #6576.

I added a check to check whether the Identifier of a read reference exists inside of a function node which can be used later or not.

"can be used later" is meant:

  • the function is assigned to a variable.
  • the function is bound to a property, and the object can be used later.
  • the function is bound to an argument of a function call.

If a reference exists in a function which can be used later, the reference is read when the function is called.

@eslintbot
Copy link

LGTM

@eslintbot
Copy link

LGTM

@mysticatea
Copy link
Member Author

I added a check to cover #6576 (comment) in this PR.
In that case, the reference itself can be used later.

@nzakas
Copy link
Member

nzakas commented Jul 4, 2016

LGTM. Can you update the docs to account for what "can be used later" means?

@nzakas
Copy link
Member

nzakas commented Jul 5, 2016

I'll update the docs so we can merge this.

@nzakas
Copy link
Member

nzakas commented Jul 5, 2016

Actually, I'm going to hold off on merging this for now as I have some questions back on the issue.

@nzakas nzakas added do not merge This pull request should not be merged yet and removed do not merge This pull request should not be merged yet labels Jul 5, 2016
@nzakas
Copy link
Member

nzakas commented Jul 5, 2016

Okay, I misunderstood something. Nevermind. :)

@eslintbot
Copy link

LGTM

@nzakas nzakas merged commit 27700cf into master Jul 5, 2016
@mysticatea mysticatea deleted the issue6576 branch July 9, 2016 08:43
@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

4 participants