-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix: allow array spread for prefer-object-spread rule (fixes #10344) #10347
Fix: allow array spread for prefer-object-spread rule (fixes #10344) #10347
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but is it possible to make Object.assign({}, foo, ...bar, {}, baz)
warn and autofix to Object.assign({ ...foo }, ...bar, { ...baz })
?
@ljharb That almost seems like a separate change to me. Seems that we could generalize that any variables which follow object literals in an Personally, I think that should be regarded as an enhancement request. This bugfix should just be about allowing Let me know if you strongly disagree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for contributing!
(This will likely collide with #10351, but if this is merged ASAP then rebasing that one shouldn't be too tricky) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you.
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
#10344
What changes did you make? (Give an overview)
Allow, eg:
Is there anything you'd like reviewers to focus on?