You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/no-useless-spread.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
💼 This rule is enabled in the following [configs](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config): ✅ `recommended`, ☑️ `unopinionated`.
6
6
7
-
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
7
+
🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
8
8
9
9
<!-- end auto-generated rule header -->
10
10
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->
@@ -14,6 +14,7 @@
14
14
- Spread an array literal as elements of an array literal
15
15
- Spread an array literal as arguments of a call or a `new` call
16
16
- Spread an object literal as properties of an object literal
17
+
- Use an object literal with only spread properties as an `Object.assign(…)` source argument
17
18
- Spread an iterable as the only argument to a collection constructor that accepts a single iterable argument
18
19
- Use spread syntax to clone an array created inline
19
20
@@ -29,7 +30,7 @@
29
30
-`Promise.{all,allSettled,any,race}(…)`
30
31
-`Object.fromEntries(…)`
31
32
32
-
-`for…of` loop can iterate over any iterable object not just array, so it's unnecessary to convert the iterable to an array.
33
+
-`for…of` loop can iterate over any iterable object not just arrays, so it's unnecessary to convert the iterable to an array.
33
34
34
35
-`yield*` can delegate to another iterable, so it's unnecessary to convert the iterable to an array.
The `Object.assign(target, {...source})` case is intentionally suggested instead of autofixed because replacing the temporary object can change observable getter and setter timing.
0 commit comments