Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit 6cc4a34

Browse files
feat(rule): add prefer-object-spread
1 parent 2cc615d commit 6cc4a34

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

coding-styles/fixable.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,13 @@ module.exports = {
349349
// option of 2 (binary), 8 (octal), or 16 (hexadecimal).
350350
'prefer-numeric-literals': 'warn',
351351

352+
// Prefer use of an object spread over Object.assign
353+
// When Object.assign is called using an object literal as the first argument, this rule
354+
// requires using the object spread syntax instead. This rule also warns on cases where an
355+
// Object.assign call is made using a single argument that is an object literal, in this case,
356+
// the Object.assign call is not needed.
357+
'prefer-object-spread': 'warn',
358+
352359
// Suggest using template literals instead of string concatenation
353360
// This rule is aimed to flag usage of + operators with strings.
354361
'prefer-template': 'warn',

0 commit comments

Comments
 (0)