@putout/plugin-putout 28.13.0 → 28.14.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
@@ -20,6 +20,7 @@ npm i @putout/plugin-putout -D
20
20
  - ✅ [add-push-arg](#add-push-arg);
21
21
  - ✅ [add-test-args](#add-test-args);
22
22
  - ✅ [add-traverse-args](#add-traverse-args);
23
+ - ✅ [add-crawl-file](#add-crawl-file);
23
24
  - ✅ [add-track-file](#add-track-file);
24
25
  - ✅ [apply-async-formatter](#apply-async-formatter);
25
26
  - ✅ [apply-create-test](#apply-create-test);
@@ -102,6 +103,7 @@ npm i @putout/plugin-putout -D
102
103
  "putout/add-push-arg": "on",
103
104
  "putout/add-test-args": "on",
104
105
  "putout/add-traverse-args": "on",
106
+ "putout/add-crawl-file": "on",
105
107
  "putout/add-track-file": "on",
106
108
  "putout/add-await-to-progress": "on",
107
109
  "putout/apply-create-test": "on",
@@ -1580,6 +1582,26 @@ test('', async ({progress}) => {
1580
1582
  });
1581
1583
  ```
1582
1584
 
1585
+ ## add-crawl-file
1586
+
1587
+ Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/4faf27234e9c5616444d0cabd79f00be/aac768e7150635d96cd71507e4a6eb43d0899814).
1588
+
1589
+ ### ❌ Example of incorrect code
1590
+
1591
+ ```js
1592
+ export const scan = (root, {push, progress}) => {
1593
+ crawlFile();
1594
+ };
1595
+ ```
1596
+
1597
+ ### ✅ Example of correct code
1598
+
1599
+ ```js
1600
+ export const scan = (root, {push, progress, crawlFile}) => {
1601
+ crawlFile();
1602
+ };
1603
+ ```
1604
+
1583
1605
  ## add-track-file
1584
1606
 
1585
1607
  Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/faaba1ce41e6fd274bc82a8875a52bfa/b34a22fdf9080e6b2f06703760f629d83d69ff3d).
@@ -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
+ crawlFile: ['{crawlFile}', [
11
+ '(__a, __b) => __body',
12
+ '(__a) => __body',
13
+ ]],
14
+ });
@@ -16,7 +16,11 @@ export const fix = ({path}) => {
16
16
 
17
17
  export const traverse = ({push, options}) => ({
18
18
  [__json]: (path) => {
19
- const {nodeVersion = 22, putoutVersion = 41} = options;
19
+ const {
20
+ nodeVersion = 22,
21
+ putoutVersion = 41,
22
+ } = options;
23
+
20
24
  const __aPath = path.get('arguments.0');
21
25
  const {
22
26
  peerDependenciesPath,
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import * as addCrawlFile from './add-crawl-file/index.js';
1
2
  import * as applyDesturcturing from './apply-desturcturing/index.js';
2
3
  import * as convertGetFileContentToReadFileContent from './convert-get-file-content-to-read-file-content/index.js';
3
4
  import * as addPushArg from './add-push-arg/index.js';
@@ -154,4 +155,5 @@ export const rules = {
154
155
  'add-push-arg': addPushArg,
155
156
  'convert-get-file-content-to-read-file-content': convertGetFileContentToReadFileContent,
156
157
  'apply-desturcturing': applyDesturcturing,
158
+ 'add-crawl-file': addCrawlFile,
157
159
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "28.13.0",
3
+ "version": "28.14.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",