Skip to content

Commit

Permalink
Docs: Add note about support for object spread (fixes #11136) (#11395)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Thomas authored and btmills committed Feb 15, 2019
1 parent 95aa3fd commit ea8e804
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/rules/prefer-object-spread.md
Expand Up @@ -2,7 +2,7 @@

When Object.assign is called using an object literal as the first argument, this rule requires using the object spread syntax instead. This rule also warns on cases where an `Object.assign` call is made using a single argument that is an object literal, in this case, the `Object.assign` call is not needed.

Object spread is a declarative alternative which may perform better than the more dynamic, imperative `Object.assign`.
Introduced in ES2018, object spread is a declarative alternative which may perform better than the more dynamic, imperative `Object.assign`.

## Rule Details

Expand Down Expand Up @@ -46,4 +46,4 @@ Object.assign(foo, { ...baz });

## When Not To Use It

When object spread is not available in your codebase.
This rule should not be used unless ES2018 is supported in your codebase.

0 comments on commit ea8e804

Please sign in to comment.