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 ignoreRestSiblings check assignments (fixes #14163) #14264

Merged
merged 3 commits into from Apr 3, 2021

Conversation

yeonjuan
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an 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 #14163 by checking references also.

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

no.

@eslint-github-bot eslint-github-bot bot added the triage An ESLint team member will look at this issue soon label Mar 29, 2021
REST_PROPERTY_TYPE.test(patternNode.properties[patternNode.properties.length - 1].type)
);
});
const hasRestSiblingDef = variable.defs.some(def => hasRestSibling(def.name.parent));
Copy link
Member

Choose a reason for hiding this comment

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

Could we extend these variable names to hasRestSiblingDefinition and hasRestSiblingReference? Right now these are a bit hard to distinguish from one another.

Copy link
Member Author

Choose a reason for hiding this comment

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

@nzakas Thanks for the review. I fixed it. 👍

@mdjermanovic mdjermanovic 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 and removed triage An ESLint team member will look at this issue soon labels Apr 1, 2021
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.

Code LGTM. Can you add an example to the documentation?

@yeonjuan
Copy link
Member Author

yeonjuan commented Apr 2, 2021

@nzakas Sure 👍 e556f51

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. Thanks.

Copy link
Member

@mdjermanovic mdjermanovic 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!

@mdjermanovic mdjermanovic changed the title Fix: Check assignment reference in no-unused-vars (fixes #14163) Fix: no-unused-vars ignoreRestSiblings check assignments (fixes #14163) Apr 3, 2021
@mdjermanovic mdjermanovic merged commit c4d8b0d into master Apr 3, 2021
@mdjermanovic mdjermanovic deleted the issue-14163 branch April 3, 2021 23:32
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Oct 1, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Oct 1, 2021
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 with ignoreRestSiblings:true reports false-positives
3 participants