Skip to content

Commit 50d56a3

Browse files
committed
chore: use @putout/printer
1 parent 9793871 commit 50d56a3

13 files changed

+30
-51
lines changed

packages/plugin-split-nested-destructuring/.madrun.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ export default {
1010
'coverage': async () => `c8 ${await run('test')}`,
1111
'report': () => 'c8 report --reporter=lcov',
1212
};
13-

packages/plugin-split-nested-destructuring/.putout.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"printer": "putout",
23
"match": {
34
"*.md": {
45
"split-nested-destructuring": "off"

packages/plugin-split-nested-destructuring/README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ npm i @putout/plugin-split-nested-destructuring -D
3030

3131
```js
3232
const {
33-
a: {b},
34-
a: {b: x},
33+
a: {
34+
b,
35+
},
36+
a: {
37+
b: x,
38+
},
3539
} = c;
3640

3741
function f({a: {b}}) {
@@ -43,10 +47,7 @@ function f({a: {b}}) {
4347

4448
```js
4549
const {a} = c;
46-
const {
47-
b,
48-
b: x,
49-
} = a;
50+
const {b, b: x} = a;
5051

5152
function f({a}) {
5253
const {b} = a;

packages/plugin-split-nested-destructuring/lib/split-nested-destructuring.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
'use strict';
22

3-
const {types, template} = require('putout');
3+
const {
4+
types,
5+
template,
6+
} = require('putout');
7+
48
const {
59
ObjectPattern,
610
ObjectProperty,

packages/plugin-split-nested-destructuring/test/fixture/computed.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const {
22
[hello]: {
3-
world
3+
world,
44
}
55
} = abc;
66

packages/plugin-split-nested-destructuring/test/fixture/couple.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ const {
33
world: {
44
a = 0,
55
b = 0,
6-
}
6+
},
77
}
88
} = z;

packages/plugin-split-nested-destructuring/test/fixture/declared.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const {
22
hello: {
3-
world
3+
world,
44
}
55
} = abc;
66

Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
const {
2-
hello
3-
} = y,
4-
{
5-
world = 0
6-
} = hello;
1+
const {hello} = y, {world = 0} = hello;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
const {
2-
a
3-
} = c,
4-
{
5-
b
6-
} = a;
1+
const {a} = c, {b} = a;
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
function f({ a: a }) {
2-
const {
3-
b: b
4-
} = a;
5-
6-
console.log(b);
1+
function f({a: a}) {
2+
const {b: b} = a;
3+
console.log(b);
74
}
8-
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
const {
2-
a
3-
} = getA(),
4-
{
5-
b: c = {}
6-
} = a;
1+
const {a} = getA(), {b: c = {}} = a;
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
function f({ a: a }) {
2-
const {
3-
b: x
4-
} = a;
5-
6-
console.log(x);
1+
function f({a: a}) {
2+
const {b: x} = a;
3+
console.log(x);
74
}
85

9-
const {
10-
a
11-
} = x,
12-
{
13-
b: c
14-
} = a;
15-
6+
const {a} = x, {b: c} = a;

packages/plugin-split-nested-destructuring/test/split-nested-destructuring.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const {createTest} = require('@putout/test');
44
const splitDestructuring = require('..');
55

66
const test = createTest(__dirname, {
7-
'split-destructuring': splitDestructuring,
7+
printer: 'putout',
8+
plugins: [
9+
['split-destructuring', splitDestructuring],
10+
],
811
});
912

1013
test('plugin-split-destructuring: report', (t) => {
@@ -51,4 +54,3 @@ test('plugin-split-destructuring: no transform: computed', (t) => {
5154
t.noTransform('computed');
5255
t.end();
5356
});
54-

0 commit comments

Comments
 (0)