Skip to content

Conversation

@janowsiany
Copy link
Contributor

@janowsiany janowsiany commented Oct 5, 2018

At the moment the rule disallows more than one ignored value in series. However I can tune this, I can allow to ignore at most one value at the beginning if you find current behaviour too mild.
Fixes #197

Copy link
Contributor

@jfmengels jfmengels left a comment

Choose a reason for hiding this comment

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

It would be nice to have additional tests for the array destructuring in arguments, like function a([, b]) {}. From what I have gathered, it should handle this case well, but more test cases can't hurt.

Thanks @janowsiany for working on this!

Copy link
Contributor

@jfmengels jfmengels 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 @janowsiany!

@sindresorhus sindresorhus changed the title Add no-unreadable-array-destructuring rule Add no-unreadable-array-destructuring rule Oct 28, 2018
@sindresorhus
Copy link
Owner

Thanks for working on this, @janowsiany 🙌

@sindresorhus
Copy link
Owner

The rule needs to be added to the bottom of the list here: https://github.com/sindresorhus/eslint-plugin-unicorn#rules

@MrHen
Copy link
Contributor

MrHen commented Oct 29, 2018

Should this rule allow [,,...rest]? Either way, adding it to examples and tests would be good.

@janowsiany
Copy link
Contributor Author

@sindresorhus @MrHen thanks for review

@sindresorhus sindresorhus merged commit 62c51a7 into sindresorhus:master Dec 15, 2018
@sindresorhus
Copy link
Owner

Thank you, @janowsiany :)

"unicorn/prefer-add-event-listener": "error",
"unicorn/no-console-spaces": "error"
"unicorn/no-console-spaces": "error",
"no-unreadable-array-destructuring": "error"
Copy link
Contributor

@futpib futpib Dec 27, 2018

Choose a reason for hiding this comment

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

Isn't this line missing a "unicorn/" prefix?

Copy link
Owner

Choose a reason for hiding this comment

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

Yup, thanks for noticing: 6bd6156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants