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

[New] destructuring-assignment: add option destructureInSignature #3235

Merged
merged 1 commit into from Mar 16, 2022

Conversation

golopot
Copy link
Contributor

@golopot golopot commented Mar 6, 2022

closes #3232.

@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2022

Codecov Report

Merging #3235 (567bc7d) into master (37b4f8e) will decrease coverage by 0.01%.
The diff coverage is 90.47%.

@@            Coverage Diff             @@
##           master    #3235      +/-   ##
==========================================
- Coverage   97.69%   97.67%   -0.02%     
==========================================
  Files         121      121              
  Lines        8554     8575      +21     
  Branches     3100     3112      +12     
==========================================
+ Hits         8357     8376      +19     
- Misses        197      199       +2     
Impacted Files Coverage Δ
lib/rules/destructuring-assignment.js 97.39% <90.47%> (-1.55%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 37b4f8e...567bc7d. Read the comment docs.

Copy link
Member

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

Looks good overall!

@@ -104,3 +104,33 @@ class Foo extends React.PureComponent {
bar = this.props.bar
}
```

### `destructAtParameter` (default: "ignore")
Copy link
Member

Choose a reason for hiding this comment

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

maybe destructureInSignature is better? "destruct" implies it's destroying it, and "parameter" is technically correct but often confused with "argument"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My English destructs.

docs/rules/destructuring-assignment.md Outdated Show resolved Hide resolved
docs/rules/destructuring-assignment.md Outdated Show resolved Hide resolved
lib/rules/destructuring-assignment.js Outdated Show resolved Hide resolved
lib/rules/destructuring-assignment.js Outdated Show resolved Hide resolved
lib/rules/destructuring-assignment.js Outdated Show resolved Hide resolved
Copy link
Member

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

Seems great!

@ljharb ljharb changed the title [New] destructuring-assignment: add option destructAtParameter [New] destructuring-assignment: add option destructureInSignature Mar 16, 2022
@ljharb ljharb merged commit 567bc7d into jsx-eslint:master Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

react/destructuring-assignment: Enforce destructuring props at function parameter
3 participants