question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🎉 Object Rest/Spread Properties arrived at stage 4

See original GitHub issue

https://github.com/tc39/proposals/commit/7a04292f2e6f11fbcfef8a7b20a0bf5aedba79a4

It’s the time to update our rules to be according to the current ESTree spec.

  • Update Espree to support the syntax in ecmaVersion:2018. I think we should keep ecmaFeatures.experimentalObjectRestSpread to avoid breaking changes.
    1. If ecmaVersion:2018 and no ecmaFeatures.experimentalObjectRestSpread, Espree generates RestElement/SpreadElement.
    2. If ecmaFeatures.experimentalObjectRestSpread:true, Espree generates ExperimentalRestProperty/ExperimentalSpreadProperty as is.
  • Update core rules to support the syntax.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
platinumazurecommented, Jan 25, 2018

@ljharb A similar argument could be made for no-dupe-keys with getters on the keys. The recommendation in both cases is the same: Use inline disable comments judiciously, or don’t use the rule. We can’t expect rules to account for all possible edge cases. 😄

2reactions
not-an-aardvarkcommented, Jan 25, 2018

I don’t have a problem with ESLint getting confused if someone is using object spread for the purpose of repeatedly invoking a getter with side-effects, because anyone reading that code will probably be confused too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An Easy Guide to Object Rest/Spread Properties in JavaScript
Object spread allows easily to clone, merge, extend objects. While object rest collects rest of properties after destructuring.
Read more >
ECMAScript - Object Rest/Spread Properties in ES2018 (ES9)
This article will examine the "Object Rest/Spread Properties" proposal which has been reached stage 4 in the TC39 process and will be ...
Read more >
Why using object spread with reduce probably a bad idea
Explore why using object spread with .reduce() can sometimes significantly affect the performance of your JavaScript apps and libraries.
Read more >
Tweets with replies by swisstofu (@swisstofu) / Twitter
No need to implement list formatting yourself The Intl.ListFormat object ... Rest/spread for properties made it to stage 4 and will be part...
Read more >
Changelog - Cypress Documentation
Upgraded the bundled electron version shipped with Cypress from 18.0.4 to 18.3.0 . ... including async/await, object rest spread, and class properties.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found