@putout/plugin-putout 28.7.0 → 28.9.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 CHANGED
@@ -17,6 +17,7 @@ npm i @putout/plugin-putout -D
17
17
  - ✅ [add-places-to-compare-places](#add-places-to-compare-places);
18
18
  - ✅ [add-path-arg-to-fix](#add-path-arg-to-fix);
19
19
  - ✅ [add-path-arg-to-visitors](#add-path-arg-to-visitors);
20
+ - ✅ [add-push-arg](#add-push-arg);
20
21
  - ✅ [add-test-args](#add-test-args);
21
22
  - ✅ [add-traverse-args](#add-traverse-args);
22
23
  - ✅ [add-track-file](#add-track-file);
@@ -96,6 +97,7 @@ npm i @putout/plugin-putout -D
96
97
  "putout/add-places-to-compare-places": "on",
97
98
  "putout/add-path-arg-to-fix": "on",
98
99
  "putout/add-path-arg-to-visitors": "on",
100
+ "putout/add-push-arg": "on",
99
101
  "putout/add-test-args": "on",
100
102
  "putout/add-traverse-args": "on",
101
103
  "putout/add-track-file": "on",
@@ -1401,6 +1403,30 @@ export const traverse = () => ({
1401
1403
  });
1402
1404
  ```
1403
1405
 
1406
+ ## add-push-arg
1407
+
1408
+ Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/cae7b14fa6be0fe50b134839bea1e544/37f9d161146dbe4f0497f852ba54161a759f7cbd).
1409
+
1410
+ ### ❌ Example of incorrect code
1411
+
1412
+ ```js
1413
+ export const scan = (root, {trackFile}) => {
1414
+ for (const file of trackFile(root, names)) {
1415
+ push(file);
1416
+ }
1417
+ };
1418
+ ```
1419
+
1420
+ ### ✅ Example of correct code
1421
+
1422
+ ```js
1423
+ export const scan = (root, {trackFile, push}) => {
1424
+ for (const file of trackFile(root, names)) {
1425
+ push(file);
1426
+ }
1427
+ };
1428
+ ```
1429
+
1404
1430
  ## add-test-args
1405
1431
 
1406
1432
  ### ❌ Example of incorrect code
@@ -0,0 +1,14 @@
1
+ import {operator} from 'putout';
2
+
3
+ const {addArgs} = operator;
4
+
5
+ export const {
6
+ report,
7
+ fix,
8
+ traverse,
9
+ } = addArgs({
10
+ push: ['{push}', [
11
+ '(__a, __b) => __body',
12
+ '(__a) => __body',
13
+ ]],
14
+ });
@@ -1,5 +1,6 @@
1
1
  export default {
2
2
  findFile: 'const {findFile} = operator',
3
+ findFileUp: 'const {findFileUp} = operator',
3
4
  renameFile: 'const {renameFile} = operator',
4
5
  renameFiles: 'const {renameFiles} = operator',
5
6
  removeFile: 'const {removeFile} = operator',
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import * as addPushArg from './add-push-arg/index.js';
1
2
  import * as convertReplaceToTraverse from './convert-replace-to-traverse/index.js';
2
3
  import * as applyEngineNodeVersion from './apply-engine-node-version/index.js';
3
4
  import * as convertPushObjectToPushPath from './convert-push-object-to-push-path/index.js';
@@ -148,4 +149,5 @@ export const rules = {
148
149
  'convert-push-object-to-push-path': convertPushObjectToPushPath,
149
150
  'apply-engine-node-version': applyEngineNodeVersion,
150
151
  'convert-replace-to-traverse': convertReplaceToTraverse,
152
+ 'add-push-arg': addPushArg,
151
153
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "28.7.0",
3
+ "version": "28.9.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",
@@ -42,7 +42,7 @@
42
42
  "plugin"
43
43
  ],
44
44
  "devDependencies": {
45
- "@putout/eslint-flat": "^3.0.0",
45
+ "@putout/eslint-flat": "^4.0.0",
46
46
  "@putout/plugin-destructuring": "*",
47
47
  "@putout/plugin-esm": "*",
48
48
  "@putout/plugin-nodejs": "*",
@@ -51,7 +51,7 @@
51
51
  "c8": "^10.0.0",
52
52
  "eslint": "^10.0.0-alpha.0",
53
53
  "eslint-plugin-n": "^17.0.0",
54
- "eslint-plugin-putout": "^29.0.0",
54
+ "eslint-plugin-putout": "^30.0.0",
55
55
  "madrun": "^12.0.0",
56
56
  "montag": "^1.2.1",
57
57
  "nodemon": "^3.0.1",