@putout/engine-runner 17.0.1 → 17.1.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/lib/replace/index.js +12 -5
- package/package.json +3 -3
package/lib/replace/index.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const {template} = require('@putout/engine-parser');
|
|
4
|
-
|
|
3
|
+
const {template, print} = require('@putout/engine-parser');
|
|
4
|
+
const {remove, replaceWith} = require('@putout/operate');
|
|
5
5
|
const {
|
|
6
6
|
isExpression,
|
|
7
7
|
isStatement,
|
|
8
8
|
isExpressionStatement,
|
|
9
9
|
} = require('@babel/types');
|
|
10
10
|
|
|
11
|
-
const {remove, replaceWith} = require('@putout/operate');
|
|
12
|
-
|
|
13
11
|
const {
|
|
14
12
|
compare,
|
|
15
13
|
findVarsWays,
|
|
@@ -21,6 +19,15 @@ const debug = require('debug')('putout:runner:replace');
|
|
|
21
19
|
const maybeArray = require('../maybe-array');
|
|
22
20
|
|
|
23
21
|
const watermark = require('./watermark');
|
|
22
|
+
const PRINT_OPTIONS = {
|
|
23
|
+
printer: ['putout', {
|
|
24
|
+
format: {
|
|
25
|
+
newline: '',
|
|
26
|
+
indent: '',
|
|
27
|
+
splitter: ' ',
|
|
28
|
+
},
|
|
29
|
+
}],
|
|
30
|
+
};
|
|
24
31
|
const isString = (a) => typeof a === 'string';
|
|
25
32
|
|
|
26
33
|
const log = (from, path) => {
|
|
@@ -197,5 +204,5 @@ function checkExpressionStatement(nodeFrom, nodeTo, path) {
|
|
|
197
204
|
if (isExpressionStatement(path) || isExpressionStatement(path.parentPath))
|
|
198
205
|
return;
|
|
199
206
|
|
|
200
|
-
throw Error(`☝️ Looks like try to put Statement in place of Expression, use 'match' to filter out such cases`);
|
|
207
|
+
throw Error(`☝️ Looks like a try to put Statement in place of Expression, use 'match' to filter out such cases: '${print(nodeFrom, PRINT_OPTIONS)} -> ${print(nodeTo, PRINT_OPTIONS)}'. For code: '${path}'`);
|
|
201
208
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/engine-runner",
|
|
3
|
-
"version": "17.0
|
|
3
|
+
"version": "17.1.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Run 🐊Putout plugins",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"c8": "^8.0.0",
|
|
48
48
|
"eslint": "^8.0.1",
|
|
49
49
|
"eslint-plugin-n": "^16.0.0",
|
|
50
|
-
"eslint-plugin-putout": "^
|
|
50
|
+
"eslint-plugin-putout": "^18.0.0",
|
|
51
51
|
"just-camel-case": "^4.0.2",
|
|
52
52
|
"lerna": "^6.0.1",
|
|
53
53
|
"madrun": "^9.0.0",
|
|
54
54
|
"mock-require": "^3.0.3",
|
|
55
55
|
"montag": "^1.0.0",
|
|
56
|
-
"nodemon": "^
|
|
56
|
+
"nodemon": "^3.0.1",
|
|
57
57
|
"putout": "*",
|
|
58
58
|
"supertape": "^8.0.0"
|
|
59
59
|
},
|