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

Fix: support Rest/Spread Properties (fixes #9885) #9943

Merged
merged 2 commits into from Feb 10, 2018

Conversation

mysticatea
Copy link
Member

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 to ecmaVersion: 2018". I cloned all tests which have experimentalObjectRestSpread: true option, then rewrote it to ecmaVersion: 2018.

I updated the tests of 14 rules, then I fixed 4 rules (no-self-assign, no-unused-vars, object-shorthand, and rest-spread-spacing).

Is there anything you'd like reviewers to focus on?

Nothing in particular.

property.shorthand ||
property.kind !== "init" || property.type !== "Property") // Could be "ExperimentalSpreadProperty" or "SpreadProperty"
property.kind !== "init" ||
property.type !== "Property" // Could be "ExperimentalSpreadProperty" or "SpreadElement"
Copy link
Member Author

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 }
Copy link
Member Author

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.

Copy link
Member

@platinumazure platinumazure left a 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.

Copy link
Sponsor Contributor

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

Does no-param-reassign need any treatment?

@mysticatea
Copy link
Member Author

@ljharb I'll check it.

@mysticatea
Copy link
Member Author

It's no problem. I added test cases.

@not-an-aardvark not-an-aardvark merged commit e8efdd0 into master Feb 10, 2018
@not-an-aardvark not-an-aardvark deleted the rest-spread-properties branch February 10, 2018 03:12
@not-an-aardvark
Copy link
Member

Thanks for contributing!

This was referenced Mar 19, 2018
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Aug 10, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Aug 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🎉 Object Rest/Spread Properties arrived at stage 4
5 participants