@putout/plugin-putout 10.2.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -47
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-putout.svg?style=flat&longCache=true
|
|
4
4
|
[NPMURL]: https://npmjs.org/package/@putout/plugin-putout"npm"
|
|
5
5
|
|
|
6
|
-
🐊[
|
|
6
|
+
🐊[**Putout**](https://github.com/coderaiser/putout) plugin helps with plugins development.
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -47,7 +47,7 @@ npm i @putout/plugin-putout -D
|
|
|
47
47
|
|
|
48
48
|
## apply-processors-destructuring
|
|
49
49
|
|
|
50
|
-
### ❌
|
|
50
|
+
### ❌ Example of incorrect code
|
|
51
51
|
|
|
52
52
|
```js
|
|
53
53
|
test('', async (t) => {
|
|
@@ -56,7 +56,7 @@ test('', async (t) => {
|
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
### ✅
|
|
59
|
+
### ✅ Example of correct code
|
|
60
60
|
|
|
61
61
|
```js
|
|
62
62
|
test('', async ({process}) => {
|
|
@@ -66,7 +66,7 @@ test('', async ({process}) => {
|
|
|
66
66
|
|
|
67
67
|
## apply-async-formatter
|
|
68
68
|
|
|
69
|
-
### ❌
|
|
69
|
+
### ❌ Example of incorrect code
|
|
70
70
|
|
|
71
71
|
```js
|
|
72
72
|
test('formatter: codeframea', (t) => {
|
|
@@ -75,7 +75,7 @@ test('formatter: codeframea', (t) => {
|
|
|
75
75
|
});
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
### ✅
|
|
78
|
+
### ✅ Example of correct code
|
|
79
79
|
|
|
80
80
|
```js
|
|
81
81
|
test('formatter: codeframea', async ({format}) => {
|
|
@@ -85,7 +85,7 @@ test('formatter: codeframea', async ({format}) => {
|
|
|
85
85
|
|
|
86
86
|
## apply-create-test
|
|
87
87
|
|
|
88
|
-
### ❌
|
|
88
|
+
### ❌ Example of incorrect code
|
|
89
89
|
|
|
90
90
|
```js
|
|
91
91
|
const test = require('@putout/test')({
|
|
@@ -93,7 +93,7 @@ const test = require('@putout/test')({
|
|
|
93
93
|
});
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
### ✅
|
|
96
|
+
### ✅ Example of correct code
|
|
97
97
|
|
|
98
98
|
```js
|
|
99
99
|
const {createTest} = require('@putout/test');
|
|
@@ -106,7 +106,7 @@ const test = createTest({
|
|
|
106
106
|
|
|
107
107
|
Fixes results of [@putout/convert-commonjs-to-esm](https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-commonjs-to-esm) work.
|
|
108
108
|
|
|
109
|
-
### ❌
|
|
109
|
+
### ❌ Example of incorrect code
|
|
110
110
|
|
|
111
111
|
```js
|
|
112
112
|
import putoutTest from '@putout/test';
|
|
@@ -116,7 +116,7 @@ const test = putoutTest(__dirname, {
|
|
|
116
116
|
});
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
### ✅
|
|
119
|
+
### ✅ Example of correct code
|
|
120
120
|
|
|
121
121
|
```js
|
|
122
122
|
import createTest from '@putout/test';
|
|
@@ -128,7 +128,7 @@ const test = createTest(__dirname, {
|
|
|
128
128
|
|
|
129
129
|
## convert-to-no-transform-code
|
|
130
130
|
|
|
131
|
-
### ❌
|
|
131
|
+
### ❌ Example of incorrect code
|
|
132
132
|
|
|
133
133
|
```js
|
|
134
134
|
test('plugin-apply-destructuring: transform: array: destructuring', (t) => {
|
|
@@ -139,7 +139,7 @@ test('plugin-apply-destructuring: transform: array: destructuring', (t) => {
|
|
|
139
139
|
});
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
### ✅
|
|
142
|
+
### ✅ Example of correct code
|
|
143
143
|
|
|
144
144
|
```js
|
|
145
145
|
test('plugin-apply-destructuring: transform: array: destructuring', (t) => {
|
|
@@ -152,7 +152,7 @@ test('plugin-apply-destructuring: transform: array: destructuring', (t) => {
|
|
|
152
152
|
|
|
153
153
|
## convert-replace-with
|
|
154
154
|
|
|
155
|
-
### ❌
|
|
155
|
+
### ❌ Example of incorrect code
|
|
156
156
|
|
|
157
157
|
```js
|
|
158
158
|
module.exports.fix = (path) => {
|
|
@@ -160,7 +160,7 @@ module.exports.fix = (path) => {
|
|
|
160
160
|
};
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
### ✅
|
|
163
|
+
### ✅ Example of correct code
|
|
164
164
|
|
|
165
165
|
```js
|
|
166
166
|
const {replaceWith} = require('putout').operator;
|
|
@@ -172,7 +172,7 @@ module.exports.fix = (path) => {
|
|
|
172
172
|
|
|
173
173
|
## convert-replace-with-multiple
|
|
174
174
|
|
|
175
|
-
### ❌
|
|
175
|
+
### ❌ Example of incorrect code
|
|
176
176
|
|
|
177
177
|
```js
|
|
178
178
|
module.exports.fix = (path) => {
|
|
@@ -180,7 +180,7 @@ module.exports.fix = (path) => {
|
|
|
180
180
|
};
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
### ✅
|
|
183
|
+
### ✅ Example of correct code
|
|
184
184
|
|
|
185
185
|
```js
|
|
186
186
|
const {replaceWithMultiple} = require('putout').operator;
|
|
@@ -192,7 +192,7 @@ module.exports.fix = (path) => {
|
|
|
192
192
|
|
|
193
193
|
## convert-replace-to-function
|
|
194
194
|
|
|
195
|
-
### ❌
|
|
195
|
+
### ❌ Example of incorrect code
|
|
196
196
|
|
|
197
197
|
```js
|
|
198
198
|
module.exports.replace = {
|
|
@@ -200,7 +200,7 @@ module.exports.replace = {
|
|
|
200
200
|
};
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
-
### ✅
|
|
203
|
+
### ✅ Example of correct code
|
|
204
204
|
|
|
205
205
|
```js
|
|
206
206
|
module.exports.replace = () => ({
|
|
@@ -210,7 +210,7 @@ module.exports.replace = () => ({
|
|
|
210
210
|
|
|
211
211
|
## convert-match-to-function
|
|
212
212
|
|
|
213
|
-
### ❌
|
|
213
|
+
### ❌ Example of incorrect code
|
|
214
214
|
|
|
215
215
|
```js
|
|
216
216
|
module.exports.match = {
|
|
@@ -218,7 +218,7 @@ module.exports.match = {
|
|
|
218
218
|
};
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
### ✅
|
|
221
|
+
### ✅ Example of correct code
|
|
222
222
|
|
|
223
223
|
```js
|
|
224
224
|
module.exports.match = () => ({
|
|
@@ -228,7 +228,7 @@ module.exports.match = () => ({
|
|
|
228
228
|
|
|
229
229
|
## convert-babel-types
|
|
230
230
|
|
|
231
|
-
### ❌
|
|
231
|
+
### ❌ Example of incorrect code
|
|
232
232
|
|
|
233
233
|
```js
|
|
234
234
|
const {
|
|
@@ -239,7 +239,7 @@ const {
|
|
|
239
239
|
} = require('@babel/types');
|
|
240
240
|
```
|
|
241
241
|
|
|
242
|
-
### ✅
|
|
242
|
+
### ✅ Example of correct code
|
|
243
243
|
|
|
244
244
|
```js
|
|
245
245
|
const {
|
|
@@ -252,7 +252,7 @@ const {
|
|
|
252
252
|
|
|
253
253
|
## convert-to-no-transform-code
|
|
254
254
|
|
|
255
|
-
### ❌
|
|
255
|
+
### ❌ Example of incorrect code
|
|
256
256
|
|
|
257
257
|
```js
|
|
258
258
|
module.exports.replace = () => ({
|
|
@@ -263,7 +263,7 @@ module.exports.replace = () => ({
|
|
|
263
263
|
});
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
### ✅
|
|
266
|
+
### ✅ Example of correct code
|
|
267
267
|
|
|
268
268
|
```js
|
|
269
269
|
module.exports.replace = () => ({
|
|
@@ -276,13 +276,13 @@ module.exports.replace = () => ({
|
|
|
276
276
|
|
|
277
277
|
## convert-node-to-path-in-get-template-values
|
|
278
278
|
|
|
279
|
-
### ❌
|
|
279
|
+
### ❌ Example of incorrect code
|
|
280
280
|
|
|
281
281
|
```js
|
|
282
282
|
const {__a, __b} = getTemplateValues(path.node, 'const __a = __b');
|
|
283
283
|
```
|
|
284
284
|
|
|
285
|
-
### ✅
|
|
285
|
+
### ✅ Example of correct code
|
|
286
286
|
|
|
287
287
|
```js
|
|
288
288
|
const {__a, __b} = getTemplateValues(path, 'const __a = __b');
|
|
@@ -290,13 +290,13 @@ const {__a, __b} = getTemplateValues(path, 'const __a = __b');
|
|
|
290
290
|
|
|
291
291
|
## shorten-imports
|
|
292
292
|
|
|
293
|
-
### ❌
|
|
293
|
+
### ❌ Example of incorrect code
|
|
294
294
|
|
|
295
295
|
```js
|
|
296
296
|
const parseOptions = require('putout/lib/parse-options');
|
|
297
297
|
```
|
|
298
298
|
|
|
299
|
-
### ✅
|
|
299
|
+
### ✅ Example of correct code
|
|
300
300
|
|
|
301
301
|
```js
|
|
302
302
|
const parseOptions = require('putout/parse-options');
|
|
@@ -304,7 +304,7 @@ const parseOptions = require('putout/parse-options');
|
|
|
304
304
|
|
|
305
305
|
## convert-traverse-to-include
|
|
306
306
|
|
|
307
|
-
### ❌
|
|
307
|
+
### ❌ Example of incorrect code
|
|
308
308
|
|
|
309
309
|
```js
|
|
310
310
|
module.exports.traverse = ({push}) => ({
|
|
@@ -314,7 +314,7 @@ module.exports.traverse = ({push}) => ({
|
|
|
314
314
|
});
|
|
315
315
|
```
|
|
316
316
|
|
|
317
|
-
### ✅
|
|
317
|
+
### ✅ Example of correct code
|
|
318
318
|
|
|
319
319
|
```js
|
|
320
320
|
module.exports.include = () => [
|
|
@@ -324,7 +324,7 @@ module.exports.include = () => [
|
|
|
324
324
|
|
|
325
325
|
## convert-traverse-to-replace
|
|
326
326
|
|
|
327
|
-
### ❌
|
|
327
|
+
### ❌ Example of incorrect code
|
|
328
328
|
|
|
329
329
|
```js
|
|
330
330
|
module.exports.traverse = () => ({
|
|
@@ -332,7 +332,7 @@ module.exports.traverse = () => ({
|
|
|
332
332
|
});
|
|
333
333
|
```
|
|
334
334
|
|
|
335
|
-
### ✅
|
|
335
|
+
### ✅ Example of correct code
|
|
336
336
|
|
|
337
337
|
```js
|
|
338
338
|
module.exports.replace = () => ({
|
|
@@ -342,14 +342,14 @@ module.exports.replace = () => ({
|
|
|
342
342
|
|
|
343
343
|
## convert-process-to-find
|
|
344
344
|
|
|
345
|
-
### ❌
|
|
345
|
+
### ❌ Example of incorrect code
|
|
346
346
|
|
|
347
347
|
```js
|
|
348
348
|
module.exports.preProcess = () => {};
|
|
349
349
|
module.exports.postProcess = () => {};
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
-
### ✅
|
|
352
|
+
### ✅ Example of correct code
|
|
353
353
|
|
|
354
354
|
```js
|
|
355
355
|
module.exports.branch = (rawSource) => [];
|
|
@@ -361,7 +361,7 @@ module.exports.merge = (processedSource, list) => '';
|
|
|
361
361
|
- property simpler to work with;
|
|
362
362
|
- support of `convert-destructuring-to-identifier` which is `Replacer`, while `convert-method-to-property` is `Includer` (searches for `ObjectMethod` node);
|
|
363
363
|
|
|
364
|
-
### ❌
|
|
364
|
+
### ❌ Example of incorrect code
|
|
365
365
|
|
|
366
366
|
```js
|
|
367
367
|
module.exports.match = () => ({
|
|
@@ -370,7 +370,7 @@ module.exports.match = () => ({
|
|
|
370
370
|
});
|
|
371
371
|
```
|
|
372
372
|
|
|
373
|
-
### ✅
|
|
373
|
+
### ✅ Example of correct code
|
|
374
374
|
|
|
375
375
|
```js
|
|
376
376
|
module.exports.match = () => ({
|
|
@@ -383,7 +383,7 @@ module.exports.match = () => ({
|
|
|
383
383
|
|
|
384
384
|
Checks that [Replacer](https://github.com/coderaiser/putout/tree/master/packages/engine-runner#replacer) transform is possible.
|
|
385
385
|
|
|
386
|
-
### ❌
|
|
386
|
+
### ❌ Example of incorrect code
|
|
387
387
|
|
|
388
388
|
```js
|
|
389
389
|
module.exports.replace = () => ({
|
|
@@ -399,14 +399,14 @@ This is additional tests, if you forget to test some case (from a big list of ru
|
|
|
399
399
|
Depend on [@putout/convert-esm-to-commonjs](https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-esm-to-commonjs) and
|
|
400
400
|
[@putout/declare-undefined-variables](https://github.com/coderaiser/putout/tree/master/packages/plugin-declare-undefined-variables)
|
|
401
401
|
|
|
402
|
-
### ❌
|
|
402
|
+
### ❌ Example of incorrect code
|
|
403
403
|
|
|
404
404
|
```js
|
|
405
405
|
compare(a, 'const __a = __b');
|
|
406
406
|
isIdentifier(a);
|
|
407
407
|
```
|
|
408
408
|
|
|
409
|
-
### ✅
|
|
409
|
+
### ✅ Example of correct code
|
|
410
410
|
|
|
411
411
|
```js
|
|
412
412
|
const {operator, types} = require('putout');
|
|
@@ -419,7 +419,7 @@ isIdentifier(a);
|
|
|
419
419
|
|
|
420
420
|
## add-args
|
|
421
421
|
|
|
422
|
-
### ❌
|
|
422
|
+
### ❌ Example of incorrect code
|
|
423
423
|
|
|
424
424
|
```js
|
|
425
425
|
test('', () => {
|
|
@@ -427,7 +427,7 @@ test('', () => {
|
|
|
427
427
|
});
|
|
428
428
|
```
|
|
429
429
|
|
|
430
|
-
### ✅
|
|
430
|
+
### ✅ Example of correct code
|
|
431
431
|
|
|
432
432
|
```js
|
|
433
433
|
test('', ({comparePlaces}) => {
|
|
@@ -446,7 +446,7 @@ module.exports = addArgument({
|
|
|
446
446
|
});
|
|
447
447
|
```
|
|
448
448
|
|
|
449
|
-
### ✅
|
|
449
|
+
### ✅ Example of correct code
|
|
450
450
|
|
|
451
451
|
```js
|
|
452
452
|
const {operator} = require('putout');
|
|
@@ -470,7 +470,7 @@ const test = createTest(__dirname, {
|
|
|
470
470
|
});
|
|
471
471
|
```
|
|
472
472
|
|
|
473
|
-
### ✅
|
|
473
|
+
### ✅ Example of correct code
|
|
474
474
|
|
|
475
475
|
```js
|
|
476
476
|
import {createTest} from '@putout/test';
|
|
@@ -492,7 +492,7 @@ const test = createTest(import.meta.url, {
|
|
|
492
492
|
});
|
|
493
493
|
```
|
|
494
494
|
|
|
495
|
-
### ✅
|
|
495
|
+
### ✅ Example of correct code
|
|
496
496
|
|
|
497
497
|
```js
|
|
498
498
|
const {createTest} = require('@putout/test');
|
|
@@ -505,7 +505,7 @@ const test = createTest(import.meta.url, {
|
|
|
505
505
|
|
|
506
506
|
## move-require-on-top-level
|
|
507
507
|
|
|
508
|
-
### ❌
|
|
508
|
+
### ❌ Example of incorrect code
|
|
509
509
|
|
|
510
510
|
```js
|
|
511
511
|
const test = require('@putout/test')(__dirname, {
|
|
@@ -520,7 +520,7 @@ test('remove debugger: report', (t) => {
|
|
|
520
520
|
});
|
|
521
521
|
```
|
|
522
522
|
|
|
523
|
-
### ✅
|
|
523
|
+
### ✅ Example of correct code
|
|
524
524
|
|
|
525
525
|
```js
|
|
526
526
|
const removeDebugger = require('..');
|
|
@@ -538,7 +538,7 @@ test('remove debugger: report', (t) => {
|
|
|
538
538
|
|
|
539
539
|
## includer
|
|
540
540
|
|
|
541
|
-
### ❌
|
|
541
|
+
### ❌ Example of incorrect code
|
|
542
542
|
|
|
543
543
|
```js
|
|
544
544
|
module.exports.include = () => 'cons __a = __b';
|
|
@@ -551,7 +551,7 @@ module.exports.include = ['cons __a = __b'];
|
|
|
551
551
|
module.exports.exclude = ['var __a = __b'];
|
|
552
552
|
```
|
|
553
553
|
|
|
554
|
-
### ✅
|
|
554
|
+
### ✅ Example of correct code
|
|
555
555
|
|
|
556
556
|
```js
|
|
557
557
|
module.exports.include = () => ['cons __a = __b'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "putout plugin helps with plugins development",
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"putout"
|
|
37
37
|
],
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@putout/test": "^
|
|
39
|
+
"@putout/test": "^5.0.0",
|
|
40
40
|
"c8": "^7.5.0",
|
|
41
41
|
"eslint": "^8.0.1",
|
|
42
42
|
"eslint-plugin-node": "^11.0.0",
|
|
43
|
-
"eslint-plugin-putout": "^
|
|
43
|
+
"eslint-plugin-putout": "^14.0.0",
|
|
44
44
|
"lerna": "^4.0.0",
|
|
45
|
-
"madrun": "^
|
|
45
|
+
"madrun": "^9.0.0",
|
|
46
46
|
"montag": "^1.2.1",
|
|
47
47
|
"nodemon": "^2.0.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"putout": ">=
|
|
50
|
+
"putout": ">=25"
|
|
51
51
|
},
|
|
52
52
|
"license": "MIT",
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
54
|
+
"node": ">=16"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|