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

mysticatea commented Feb 5, 2018

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"

This comment has been minimized.

Copy link
@mysticatea

mysticatea Feb 5, 2018

Author Member

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 }

This comment has been minimized.

Copy link
@mysticatea

mysticatea Feb 5, 2018

Author Member

Removing such as this in this file is trivial; those were unused.

Copy link
Member

platinumazure left a comment

LGTM, but would love to have another set of eyes on this.

@ljharb
ljharb approved these changes Feb 5, 2018
Copy link
Contributor

ljharb left a comment

Does no-param-reassign need any treatment?

@mysticatea

This comment has been minimized.

Copy link
Member Author

mysticatea commented Feb 6, 2018

@ljharb I'll check it.

@mysticatea

This comment has been minimized.

Copy link
Member Author

mysticatea commented Feb 6, 2018

It's no problem. I added test cases.

@not-an-aardvark not-an-aardvark merged commit e8efdd0 into master Feb 10, 2018
5 checks passed
5 checks passed
commit-message PR title follows commit message guidelines
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details
@not-an-aardvark not-an-aardvark deleted the rest-spread-properties branch Feb 10, 2018
@not-an-aardvark

This comment has been minimized.

Copy link
Member

not-an-aardvark commented Feb 10, 2018

Thanks for contributing!

This was referenced Mar 22, 2018
@renovate renovate bot mentioned this pull request Mar 23, 2018
@eslint eslint bot locked and limited conversation to collaborators Aug 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.