Skip to content

Commit 70a0d25

Browse files
committed
feature: @putout/plugin-apply-shorthand-properties: spread
1 parent 7dc73dc commit 70a0d25

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

packages/plugin-apply-shorthand-properties/lib/apply-shorthand-properties.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ export const traverse = ({push, options}) => ({
6060
const from = getName(valuePath);
6161
const to = getName(keyPath);
6262

63+
if (!from)
64+
continue;
65+
6366
if (ignore.includes(from))
6467
continue;
6568

packages/plugin-apply-shorthand-properties/test/apply-shorthand-properties.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ test('plugin-apply-shorthand-properties: transform: computed', (t) => {
109109
t.end();
110110
});
111111

112+
test('plugin-apply-shorthand-properties: no report: spread', (t) => {
113+
t.noReport('spread');
114+
t.end();
115+
});
116+
112117
testWithRemove('plugin-apply-shorthand-properties: transform with options: assign', (t) => {
113118
t.transformWithOptions('assign', {
114119
rename: true,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const a = {
2+
...options,
3+
}

0 commit comments

Comments
 (0)