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: incorrect error messages of no-unused-vars (fixes #9774) #9791

Merged
merged 1 commit into from Dec 30, 2017

Conversation

akouryy
Copy link
Contributor

@akouryy akouryy commented Dec 29, 2017

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:

What changes did you make? (Give an overview)
fixes #9774.
It showed Allowed unused vars must match {varsIgnorePattern}. for an unused argument without argsIgnorePattern specified.

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

Remove varsIgnorePattern incorrectly included in error messages of no-unused-vars.
@akouryy akouryy changed the title Fix: Remove varsIgnorePattern incorrectly included in error messages … Fix: incorrect error messages of no-unused-vars (fixes #9774) Dec 29, 2017
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.

Looks good. Could you please point me to a valid test where the argsIgnorePattern allows an unused argument, and also to an invalid test where the argsIgnorePattern shows up in the error message? (I assume these exist already but if they don't, please add them.) Thanks!

@akouryy
Copy link
Contributor Author

akouryy commented Dec 29, 2017

One of the former is https://github.com/eslint/eslint/blob/master/tests/lib/rules/no-unused-vars.js#L160 and one of the latter is https://github.com/eslint/eslint/blob/master/tests/lib/rules/no-unused-vars.js#L342.

@platinumazure
Copy link
Member

Thank you! I'll go ahead and approve.

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! I am satisfied that the test coverage is where it needs to be.

Copy link
Member

@ilyavolodin ilyavolodin 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 for PR.

@aladdin-add aladdin-add added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules labels Dec 30, 2017
@aladdin-add aladdin-add merged commit 4c87f42 into eslint:master Dec 30, 2017
@aladdin-add
Copy link
Member

thanks for contributing! O(∩_∩)O

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 rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'no-unused-vars' shows varsIgnorePattern when argsIgnorePattern is not specified
4 participants