@putout/plugin-for-of 3.0.0 → 4.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/README.md CHANGED
@@ -67,9 +67,8 @@ for (const name of names) {
67
67
 
68
68
  ```js
69
69
  for (const item in object) {
70
- if (object.hasOwnProperty(item)) {
70
+ if (object.hasOwnProperty(item))
71
71
  log(item);
72
- }
73
72
  }
74
73
 
75
74
  for (const item in object) {
@@ -78,6 +78,14 @@ module.exports.replace = () => ({
78
78
 
79
79
  module.exports.match = () => ({
80
80
  '__.forEach(__args)': (vars, path) => {
81
+ const {parentPath} = path;
82
+
83
+ if (parentPath.isSequenceExpression())
84
+ return false;
85
+
86
+ if (parentPath.isVariableDeclarator())
87
+ return false;
88
+
81
89
  const objectPath = path.get('callee.object');
82
90
  const fnPath = path.get('arguments.0');
83
91
 
@@ -67,9 +67,8 @@ function isReferenced({scope}, path) {
67
67
  return !current || current.referenced;
68
68
  }
69
69
 
70
- if (path.isObjectPattern()) {
70
+ if (path.isObjectPattern())
71
71
  return true;
72
- }
73
72
 
74
73
  const {node} = path;
75
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-for-of",
3
- "version": "3.0.0",
3
+ "version": "4.1.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds ability to apply for...of",
@@ -40,22 +40,22 @@
40
40
  "@putout/plugin-remove-unused-variables": "*",
41
41
  "@putout/plugin-remove-useless-arguments": "*",
42
42
  "@putout/plugin-remove-useless-continue": "*",
43
- "@putout/test": "^7.0.0",
44
- "c8": "^8.0.0",
45
- "eslint": "^8.0.1",
43
+ "@putout/test": "^8.0.0",
44
+ "c8": "^9.0.0",
45
+ "eslint": "^9.0.0-alpha.0",
46
46
  "eslint-plugin-n": "^16.0.0",
47
- "eslint-plugin-putout": "^19.0.0",
47
+ "eslint-plugin-putout": "^22.0.0",
48
48
  "lerna": "^6.0.1",
49
- "madrun": "^9.0.0",
49
+ "madrun": "^10.0.0",
50
50
  "montag": "^1.2.1",
51
51
  "nodemon": "^3.0.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "putout": ">=31"
54
+ "putout": ">=34"
55
55
  },
56
56
  "license": "MIT",
57
57
  "engines": {
58
- "node": ">=16"
58
+ "node": ">=18"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public"