@putout/engine-runner 17.0.1 → 17.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.
@@ -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,16 @@ 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
+ };
31
+
24
32
  const isString = (a) => typeof a === 'string';
25
33
 
26
34
  const log = (from, path) => {
@@ -197,5 +205,5 @@ function checkExpressionStatement(nodeFrom, nodeTo, path) {
197
205
  if (isExpressionStatement(path) || isExpressionStatement(path.parentPath))
198
206
  return;
199
207
 
200
- throw Error(`☝️ Looks like try to put Statement in place of Expression, use 'match' to filter out such cases`);
208
+ 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
209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/engine-runner",
3
- "version": "17.0.1",
3
+ "version": "17.2.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Run 🐊Putout plugins",
@@ -28,7 +28,7 @@
28
28
  "@babel/types": "^7.12.7",
29
29
  "@putout/compare": "^11.0.0",
30
30
  "@putout/engine-parser": "^7.0.0",
31
- "@putout/operate": "^8.0.0",
31
+ "@putout/operate": "^9.0.0",
32
32
  "@putout/operator-declare": "^6.0.1",
33
33
  "debug": "^4.1.1",
34
34
  "jessy": "^3.0.0",
@@ -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": "^17.0.0",
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": "^2.0.1",
56
+ "nodemon": "^3.0.1",
57
57
  "putout": "*",
58
58
  "supertape": "^8.0.0"
59
59
  },