Skip to content

Commit acc7bd5

Browse files
committed
feature: @putout/plugin-putout-config: apply-destructuring: remove-useless-variables: add
1 parent 0f62275 commit acc7bd5

File tree

7 files changed

+16
-11
lines changed

7 files changed

+16
-11
lines changed

packages/plugin-convert-const-to-let/.putout.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"match": {
33
"*.md": {
44
"convert-const-to-let": "off",
5-
"remove-unreferenced-variables": "off"
5+
"variables/remove-unreferenced": "off"
66
}
77
}
88
}

packages/plugin-putout-config/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,17 @@ Apply [`destructuring`](https://github.com/coderaiser/putout/tree/master/package
191191
- "split-call-with-destructuring": "off",
192192
- "merge-destructuring-properties": "off",
193193
- "split-nested-destructuring": "off",
194-
- "remove-useless-arguments/destructuring": "off"
194+
- "remove-useless-arguments/destructuring": "off",
195+
- "remove-useless-variables/destruct": "off"
195196
+ "destructuring": "off",
196197
+ "destructuring/remove-useless-object": "off",
197198
+ "destructuring/apply-array": "off",
198199
+ "destructuring/apply-object": "off",
199200
+ "destructuring/split-call": "off",
200201
+ "destructuring/merge-properties": "off",
201202
+ "destructuring/split-nested": "off",
202-
+ "destructuring/remove-useless-arguments": "off"
203+
+ "destructuring/remove-useless-arguments": "off",
204+
+ "destructuring/remove-useless-variables": "off"
203205
}
204206
}
205207
```

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ __putout_processor_json({
77
"destructuring/split-call": "off",
88
"destructuring/merge-properties": "off",
99
"destructuring/split-nested": "off",
10-
"destructuring/remove-useless-arguments": "off"
10+
"destructuring/remove-useless-arguments": "off",
11+
"destructuring/remove-useless-variables": "off"
1112
}
1213
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ __putout_processor_json({
88
'merge-destructuring-properties': 'off',
99
'split-nested-destructuring': 'off',
1010
'remove-useless-arguments/destructuring': 'off',
11+
'remove-useless-variables/destruct': 'off',
1112
},
1213
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const v41 = [
99
['split-call-with-destructuring', 'destructuring/split-call'],
1010
['split-nested-destructuring', 'destructuring/split-nested'],
1111
['remove-useless-arguments/destructuring', 'destructuring/remove-useless-arguments'],
12+
['remove-useless-variables/destruct', 'destructuring/remove-useless-variables'],
1213
];
1314

1415
const versions = [...v41];

packages/plugin-reuse-duplicate-init/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"init"
3434
],
3535
"devDependencies": {
36-
"@putout/plugin-remove-useless-variables": "*",
3736
"@putout/plugin-tape": "*",
37+
"@putout/plugin-variables": "*",
3838
"@putout/test": "^14.0.0",
3939
"c8": "^10.0.0",
4040
"eslint": "v10.0.0-alpha.0",

packages/plugin-reuse-duplicate-init/test/reuse-duplicate-init.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import {createRequire} from 'node:module';
21
import {createTest} from '@putout/test';
3-
import * as removeUselessVariables from '@putout/plugin-remove-useless-variables';
2+
import * as variables from '@putout/plugin-variables';
3+
import * as tape from '@putout/plugin-tape';
44
import * as reuseDuplicateInit from '../lib/reuse-duplicate-init.js';
55

6-
const require = createRequire(import.meta.url);
7-
const convertTapeToSupertape = require('@putout/plugin-tape').rules['convert-tape-to-supertape'];
8-
const applyDestructuring = require('@putout/plugin-tape').rules['apply-destructuring'];
6+
const convertTapeToSupertape = tape.rules['convert-tape-to-supertape'];
7+
const applyDestructuring = tape.rules['apply-destructuring'];
8+
const declareStub = tape.rules.declare;
99

10-
const declareStub = require('@putout/plugin-tape').rules.declare;
10+
const removeUselessVariables = variables.rules['remove-useless'];
1111

1212
const test = createTest(import.meta.url, {
1313
plugins: [

0 commit comments

Comments
 (0)