Skip to content

Relax prefer-destructuring rules#57

Merged
whymarrh merged 1 commit intomasterfrom
simplify-prefer-destructuring
Aug 20, 2020
Merged

Relax prefer-destructuring rules#57
whymarrh merged 1 commit intomasterfrom
simplify-prefer-destructuring

Conversation

@whymarrh
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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