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

Add no-unused-vars to README #1828

Merged
merged 1 commit into from
Jun 8, 2018
Merged

Add no-unused-vars to README #1828

merged 1 commit into from
Jun 8, 2018

Conversation

sangaman
Copy link
Contributor

@sangaman sangaman commented Jun 8, 2018

This documents the enforced but currently undocumented no-unused-vars rule with a brief description, examples, and noting the "ignoreRestSiblings": true option.

Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Thanks!

README.md Outdated
z = z + 1;

// Unused function arguments.
function getY(x, y) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

in this case, x won't be reported because y is used. if you return x, however, then y would be reported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting, I did not know that. Will fix.


alert(getXPlusY(x, y));

// 'type' is ignored even if unused because it has a rest property sibling.
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's elaborate on why: this is a form of extracting an object that omits specific keys.

This documents the enforced but currently undocumented `no-unused-vars` rule with a brief description, examples, and noting the `"ignoreRestSiblings": true` option.
@sangaman
Copy link
Contributor Author

sangaman commented Jun 8, 2018

Thanks, I amended the commit with your feedback.

@ljharb ljharb merged commit 74fb34f into airbnb:master Jun 8, 2018
@sangaman sangaman deleted the patch-1 branch June 8, 2018 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants