@putout/engine-runner 27.1.0 → 27.2.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
@@ -78,7 +78,7 @@ export const report = () => 'debugger should not be used';
78
78
 
79
79
  export const replace = () => ({
80
80
  debugger: '',
81
- });// debugger; alert(); -> alert();
81
+ }); // debugger; alert(); -> alert();
82
82
  ```
83
83
 
84
84
  Templates:
@@ -88,7 +88,7 @@ export const report = () => 'any message here';
88
88
 
89
89
  export const replace = () => ({
90
90
  'var __a = 1': 'const __a = 1',
91
- });// var x = 1; -> const x = 1;
91
+ }); // var x = 1; -> const x = 1;
92
92
  ```
93
93
 
94
94
  A couple variables example:
@@ -98,7 +98,7 @@ export const report = () => 'any message here';
98
98
 
99
99
  export const replace = () => ({
100
100
  'const __a = __b': 'const __b = __a',
101
- });// const hello = world; -> const world = hello;
101
+ }); // const hello = world; -> const world = hello;
102
102
  ```
103
103
 
104
104
  #### Processing of node using functions
@@ -115,7 +115,7 @@ export const replace = () => ({
115
115
  // remove node
116
116
  return '';
117
117
  },
118
- });// for (a of b) {}; alert(); -> alert();
118
+ }); // for (a of b) {}; alert(); -> alert();
119
119
  ```
120
120
 
121
121
  Update node:
@@ -129,7 +129,7 @@ export const replace = () => ({
129
129
  path.node.right.elements = [];
130
130
  return path;
131
131
  },
132
- });// for (const a of [1, 2, 3]) {}; -> for (const a of []) {};
132
+ }); // for (const a of [1, 2, 3]) {}; -> for (const a of []) {};
133
133
  ```
134
134
 
135
135
  Update node using template variables:
@@ -142,7 +142,7 @@ export const replace = () => ({
142
142
  // update the whole node using template string
143
143
  return 'for (const x of y) z';
144
144
  },
145
- });// for (const item of array) {}; -> for (const x of y) z;
145
+ }); // for (const item of array) {}; -> for (const x of y) z;
146
146
  ```
147
147
 
148
148
  ### Includer
@@ -11,14 +11,14 @@ export const getPosition = (path, shebang) => {
11
11
  if (!loc)
12
12
  return {
13
13
  line: 0,
14
- column: 0,
14
+ column: 1,
15
15
  };
16
16
 
17
17
  const {line, column} = node.loc.start;
18
18
 
19
19
  return {
20
20
  line: shebang ? line + 1 : line,
21
- column,
21
+ column: column + 1,
22
22
  };
23
23
  };
24
24
 
@@ -105,6 +105,7 @@ const createTraverse = ({scan, rule, progress}) => ({push, options}) => ({
105
105
  fileProgress,
106
106
  crawled,
107
107
  });
108
+
108
109
  const crawlFile = createCrawlFile(crawled);
109
110
 
110
111
  scan(rootPath, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/engine-runner",
3
- "version": "27.1.0",
3
+ "version": "27.2.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Run 🐊Putout plugins",