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 (fixes #7250) #7258

Merged
merged 1 commit into from Sep 30, 2016
Merged

Fix: no-unused-vars false positive (fixes #7250) #7258

merged 1 commit into from Sep 30, 2016

Conversation

mysticatea
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

See #7250 for template.

Please check each item to ensure your pull request is ready:

  • I've read the pull request guide
  • I've included tests for my change
  • I've updated documentation for my change (if appropriate)

What changes did you make? (Give an overview)

I had changed the after-used option's behavior in #7143 in order to fix the false negative that the rule overlooks unused variables if the last parameter is ignored by argsIgnorePattern.

Now, the rule has false positive that it warns the last non-ignored parameter even if the last (ignored) parameter is used.
This PR fixes the false positive.

semver-patch: A bug fix in a rule that results in ESLint reporting fewer errors.

Is there anything you'd like reviewers to focus on?

  • Is this fix needed?

@eslintbot
Copy link

LGTM

@mention-bot
Copy link

@mysticatea, thanks for your PR! By analyzing the annotation information on this pull request, we identified @vitorbal, @wavebeem and @nzakas to be potential reviewers

@vitorbal vitorbal added bug ESLint is working incorrectly accepted There is consensus among the team that this change meets the criteria for inclusion labels Sep 27, 2016
@platinumazure
Copy link
Member

platinumazure commented Sep 27, 2016

I'm 👍 for this fix- the intent of argsIgnorePattern (as I see it) is to suppress warnings for commonly ignored variables when they are unused. But if the variable is used, it should still get credit as being used.

Thanks for writing this up, @mysticatea!

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM, just want the release folks to do the merging just in case.

@nzakas nzakas merged commit dffb4fa into master Sep 30, 2016
@mysticatea mysticatea deleted the issue7250 branch October 2, 2016 00:11
@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
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants