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 2 commits into from Feb 10, 2018


Copy link

@mysticatea 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"
Copy link
Member Author

@mysticatea mysticatea Feb 5, 2018

This is trivial; I just removed extra parens.

@@ -524,7 +596,7 @@"key-spacing", rule, {
beforeColon: true,
afterColon: false
parserOptions: { ecmaVersion: 6, ecmaFeatures: { experimentalObjectRestSpread: true } }
parserOptions: { ecmaVersion: 6 }
Copy link
Member Author

@mysticatea mysticatea Feb 5, 2018

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

Copy link

@platinumazure platinumazure left a comment

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

ljharb approved these changes Feb 5, 2018
Copy link

@ljharb ljharb left a comment

Does no-param-reassign need any treatment?

Copy link
Member Author

@mysticatea mysticatea commented Feb 6, 2018

@ljharb I'll check it.

Copy link
Member Author

@mysticatea 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
@not-an-aardvark not-an-aardvark deleted the rest-spread-properties branch Feb 10, 2018
Copy link

@not-an-aardvark not-an-aardvark commented Feb 10, 2018

Thanks for contributing!

@eslint-deprecated eslint-deprecated 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.
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants