Skip to content

Commit

Permalink
Revert "docs: add more examples for prefer-object-spread (eslint#15831)"
Browse files Browse the repository at this point in the history
This reverts commit 4c76ec7.
  • Loading branch information
srijan-deepsource committed May 30, 2022
1 parent 4065559 commit 02fd8c6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/src/rules/prefer-object-spread.md
Expand Up @@ -20,15 +20,17 @@ Examples of **incorrect** code for this rule:
```js
/*eslint prefer-object-spread: "error"*/

Object.assign({}, foo);
Object.assign({}, foo)

Object.assign({}, {foo: 'bar'});
Object.assign({}, {foo: 'bar'})

Object.assign({ foo: 'bar'}, baz);
Object.assign({ foo: 'bar'}, baz)

Object.assign({}, baz, { foo: 'bar' });
Object.assign({ foo: 'bar' }, Object.assign({ bar: 'foo' }))

Object.assign({}, { ...baz });
Object.assign({}, { foo, bar, baz })

Object.assign({}, { ...baz })

// Object.assign with a single argument that is an object literal
Object.assign({});
Expand All @@ -41,16 +43,14 @@ Examples of **correct** code for this rule:
```js
/*eslint prefer-object-spread: "error"*/

({ ...foo });

({ ...baz, foo: 'bar' });
Object.assign(...foo);

// Any Object.assign call without an object literal as the first argument
Object.assign(foo, { bar: baz });

Object.assign(foo, bar);
Object.assign(foo, Object.assign(bar));

Object.assign(foo, { bar, baz });
Object.assign(foo, { bar, baz })

Object.assign(foo, { ...baz });
```
Expand Down

0 comments on commit 02fd8c6

Please sign in to comment.