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

Relax prefer-destructuring rules #57

Merged
merged 1 commit into from
Aug 20, 2020
Merged

Conversation

whymarrh
Copy link
Contributor

Refs MetaMask/metamask-extension#9263
Refs MetaMask/logo#35

This PR relaxes the prefer-destructuring rule to no longer apply to arrays, object assignment, or renamed properties. That is, the following are allowed but not required:

const first = array[0]; // before
const [first] = array; // after
foo = obj.foo; // before
({ foo } = obj); // after
const bar = obj.foo; // before
const { foo: bar } = obj; // afer

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@whymarrh whymarrh merged commit b413358 into master Aug 20, 2020
@whymarrh whymarrh deleted the simplify-prefer-destructuring branch August 20, 2020 15:56
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.

3 participants