Skip to content

Commit a667092

Browse files
committed
feature: @putout/plugin-putout-config: apply-variables: remove-unused-variables -> variables/remove-unused
1 parent 3ccdd70 commit a667092

File tree

6 files changed

+25
-5
lines changed

6 files changed

+25
-5
lines changed

packages/plugin-putout-config/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,19 +287,27 @@ Apply [`variables`](https://github.com/coderaiser/putout/tree/master/packages/pl
287287
{
288288
"rules": {
289289
- "remove-useless-variables": "off",
290+
- "remove-unused-variables": "on",
290291
- "remove-useless-variables/remove": "on",
291292
- "remove-useless-variables/assignment": "on",
292293
- "remove-useless-arguments/declaration": "on",
293294
- "remove-useless-arguments/duplicate": "on",
294295
- "remove-useless-arguments/rename": "on",
295-
- "remove-unreferenced-variables": "on"
296+
- "remove-unreferenced-variables": "on",
297+
- "convert-const-to-let": "on",
298+
- "extract-keyword-from-variables": "on"
299+
- "split-variable-declarations: "on",
296300
+ "variables": "off",
301+
+ "variables/remove-unused": "on",
297302
+ "variables/remove-useless": "on",
298303
+ "variables/remove-useless-assignment": "on",
299304
+ "variables/remove-useless-declarations": "on",
300305
+ "variables/remove-useless-duplicates": "on",
301306
+ "variables/remove-useless-rename": "on",
302-
+ "variables/remove-unreferenced": "on"
307+
+ "variables/remove-unreferenced": "on",
308+
+ "variables/convert-const-to-let": "on"
309+
+ "variables/extract-keyword": "on"
310+
+ "variables/split-declarations: "on",
303311
}
304312
}
305313
```

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
__putout_processor_json({
22
rules: {
3+
"variables/convert-const-to-let": "off",
4+
"variables/extract-keywords": "off",
5+
"variables/split-declarations": "off",
6+
"variables/remove-unused": "off",
37
"variables": "off",
48
"variables/remove-useless": "on",
59
"variables/remove-useless-assignment": "on",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
__putout_processor_json({
22
rules: {
3+
"convert-const-to-let": "off",
4+
"extract-keyword-from-variables": "off",
5+
"split-variable-declarations": "off",
6+
"remove-unused-variables": "off",
37
"remove-useless-variables": "off",
48
"remove-useless-variables/remove": "on",
59
"remove-useless-variables/assignment": "on",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ const v41 = [
88
['remove-useless-variables/duplicate', 'variables/remove-useless-duplicate'],
99
['remove-useless-variables/declaration', 'variables/remove-useless-declarations'],
1010
['remove-unreferenced-variables', 'variables/remove-unreferenced'],
11+
['convert-const-to-let', 'variables/convert-const-to-let'],
12+
['extract-keyword-from-variables', 'variables/extract-keywords'],
13+
['split-variable-declarations', 'variables/split-declarations'],
14+
['remove-unused-variables', 'variables/remove-unused'],
1115
];
1216

1317
const versions = [...v41];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__putout_processor_json({
22
"rules": {
3-
"remove-unused-variables": "on"
3+
"variables/remove-unused": "on"
44
}
55
});

packages/plugin-putout-config/test/fixture/move-formatter-up-fix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__putout_processor_json({
22
"formatter": "progress-bar",
33
"rules": {
4-
"remove-unused-variables": "off"
4+
"variables/remove-unused": "off"
55
}
66
});
77

@@ -13,6 +13,6 @@ __putout_processor_json({
1313
"parser": "babel",
1414
"formatter": "progress-bar",
1515
"rules": {
16-
"remove-unused-variables": "off"
16+
"variables/remove-unused": "off"
1717
}
1818
});

0 commit comments

Comments
 (0)