-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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: support Rest/Spread Properties (fixes #9885) #9943
Conversation
property.shorthand || | ||
property.kind !== "init" || property.type !== "Property") // Could be "ExperimentalSpreadProperty" or "SpreadProperty" | ||
property.kind !== "init" || | ||
property.type !== "Property" // Could be "ExperimentalSpreadProperty" or "SpreadElement" |
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.
This is trivial; I just removed extra parens.
@@ -524,7 +596,7 @@ ruleTester.run("key-spacing", rule, { | |||
beforeColon: true, | |||
afterColon: false | |||
}], | |||
parserOptions: { ecmaVersion: 6, ecmaFeatures: { experimentalObjectRestSpread: true } } | |||
parserOptions: { ecmaVersion: 6 } |
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.
Removing such as this in this file is trivial; those were unused.
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 would love to have another set of eyes on this.
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.
Does no-param-reassign need any treatment?
@ljharb I'll check it. |
It's no problem. I added test cases. |
Thanks for contributing! |
What is the purpose of this pull request? (put an "X" next to item)
[X] Bug fix
Fixes #9885.
What changes did you make? (Give an overview)
This PR focuses on "rules work fine if people replace
experimentalObjectRestSpread: true
toecmaVersion: 2018
". I cloned all tests which haveexperimentalObjectRestSpread: true
option, then rewrote it toecmaVersion: 2018
.I updated the tests of 14 rules, then I fixed 4 rules (
no-self-assign
,no-unused-vars
,object-shorthand
, andrest-spread-spacing
).Is there anything you'd like reviewers to focus on?
Nothing in particular.