@putout/plugin-printer 6.0.0 → 7.0.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,7 +1,6 @@
1
1
  import {operator} from 'putout';
2
2
 
3
- const {traverse} = operator;
4
-
3
+ const {compare} = operator;
5
4
  const EXTEND = `
6
5
  const test = extend({
7
6
  print: printExtension,
@@ -25,13 +24,15 @@ export const replace = () => ({
25
24
  });
26
25
 
27
26
  function check(vars, path) {
28
- let is = true;
29
27
  const programPath = path.scope.getProgramParent().path;
30
28
 
31
- traverse(programPath, {
32
- 'module.exports.createTest = (__args) => __body': () => {
33
- is = false;
34
- },
35
- });
36
- return is;
29
+ for (const current of programPath.node.body) {
30
+ if (compare(current, 'module.exports.createTest = (__args) => __body'))
31
+ return false;
32
+
33
+ if (compare(current, 'export const createTest = (__args) => __body'))
34
+ return false;
35
+ }
36
+
37
+ return true;
37
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-printer",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds support of transformations for @putout/printer",
@@ -38,21 +38,21 @@
38
38
  "@putout/plugin-declare-before-reference": "*",
39
39
  "@putout/plugin-for-of": "*",
40
40
  "@putout/plugin-remove-nested-blocks": "*",
41
- "@putout/test": "^13.0.0",
41
+ "@putout/test": "^15.0.0",
42
42
  "c8": "^10.0.0",
43
- "eslint": "^9.0.0",
43
+ "eslint": "^10.0.0-alpha.0",
44
44
  "eslint-plugin-n": "^17.0.0",
45
- "eslint-plugin-putout": "^27.0.0",
46
- "madrun": "^11.0.0",
45
+ "eslint-plugin-putout": "^29.0.0",
46
+ "madrun": "^12.0.0",
47
47
  "montag": "^1.2.1",
48
48
  "nodemon": "^3.0.1"
49
49
  },
50
50
  "peerDependencies": {
51
- "putout": ">=40"
51
+ "putout": ">=41"
52
52
  },
53
53
  "license": "MIT",
54
54
  "engines": {
55
- "node": ">=20"
55
+ "node": ">=22"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"