Skip to content

Commit a4ad151

Browse files
committed
feature: @putout/plugin-putout-config: apply-destructuring: extract-object-properties, convert-object-to-array
1 parent eedb799 commit a4ad151

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

packages/plugin-putout-config/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,20 +190,28 @@ Apply [`destructuring`](https://github.com/coderaiser/putout/tree/master/package
190190
- "apply-destructuring/falsy": "off",
191191
- "apply-destructuring/array": "off",
192192
- "apply-destructuring/object": "off",
193+
- "apply-destructuring/convert-object-to-array": "off",
193194
- "split-call-with-destructuring": "off",
194195
- "merge-destructuring-properties": "off",
195196
- "split-nested-destructuring": "off",
196197
- "remove-useless-arguments/destructuring": "off",
197-
- "remove-useless-variables/destruct": "off"
198+
- "remove-useless-variables/destruct": "off",
199+
- "extract-object-properties": "off",
200+
- "extract-object-properties/equal-deep": "off",
201+
- "extract-object-properties/not-equal-deep": "off",
198202
+ "destructuring": "off",
199203
+ "destructuring/remove-useless-object": "off",
200204
+ "destructuring/apply-array": "off",
201205
+ "destructuring/apply-object": "off",
206+
+ "destructuring/convert-object-to-array": "off",
202207
+ "destructuring/split-call": "off",
203208
+ "destructuring/merge-properties": "off",
204209
+ "destructuring/split-nested": "off",
205210
+ "destructuring/remove-useless-arguments": "off",
206211
+ "destructuring/remove-useless-variables": "off"
212+
+ "destructuring/extract-properties": "off",
213+
+ "desturucturing/extract-properties-equal-deep": "off",
214+
+ "destructurigin/extract-properties-not-equal-deep": "off",
207215
}
208216
}
209217
```

packages/plugin-putout-config/lib/apply-destructuring/fixture/apply-destructuring-fix.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ __putout_processor_json({
44
"destructuring/remove-useless-object": "off",
55
"destructuring/apply-array": "off",
66
"destructuring/apply-object": "off",
7+
"destructuring/convert-object-to-array": "off",
78
"destructuring/split-call": "off",
89
"destructuring/merge-properties": "off",
910
"destructuring/split-nested": "off",
1011
"destructuring/remove-useless-arguments": "off",
11-
"destructuring/remove-useless-variables": "off"
12+
"destructuring/remove-useless-variables": "off",
13+
"destructuring/extract-properties": "off",
14+
"destructuring/extract-properties-equal-deep": "on",
15+
"destructuring/extract-properties-not-equal-deep": "on"
1216
}
1317
});

packages/plugin-putout-config/lib/apply-destructuring/fixture/apply-destructuring.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ __putout_processor_json({
44
'apply-destructuring/falsy': 'off',
55
'apply-destructuring/array': 'off',
66
'apply-destructuring/object': 'off',
7+
'apply-destructuring/convert-object-to-array': 'off',
78
'split-call-with-destructuring': 'off',
89
'merge-destructuring-properties': 'off',
910
'split-nested-destructuring': 'off',
1011
'remove-useless-arguments/destructuring': 'off',
1112
'remove-useless-variables/destruct': 'off',
13+
'extract-object-properties': 'off',
14+
'extract-object-properties/equal-deep': 'on',
15+
'extract-object-properties/not-equal-deep': 'on',
1216
},
1317
});

packages/plugin-putout-config/lib/apply-destructuring/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ const v41 = [
55
['apply-destructuring/object', 'destructuring/apply-object'],
66
['apply-destructuring/array', 'destructuring/apply-array'],
77
['apply-destructuring/falsy', 'destructuring/remove-useless-object'],
8+
['apply-destructuring/convert-object-to-array', 'destructuring/convert-object-to-array'],
89
['merge-destructuring-properties', 'destructuring/merge-properties'],
910
['split-call-with-destructuring', 'destructuring/split-call'],
1011
['split-nested-destructuring', 'destructuring/split-nested'],
1112
['remove-useless-arguments/destructuring', 'destructuring/remove-useless-arguments'],
1213
['remove-useless-variables/destruct', 'destructuring/remove-useless-variables'],
14+
['extract-object-properties', 'destructuring/extract-properties'],
15+
['extract-object-properties/equal-deep', 'destructuring/extract-properties-equal-deep'],
16+
['extract-object-properties/not-equal-deep', 'destructuring/extract-properties-not-equal-deep'],
1317
];
1418

1519
const versions = [...v41];

0 commit comments

Comments
 (0)