@putout/plugin-for-of 4.0.0 → 5.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.
package/README.md CHANGED
@@ -15,6 +15,22 @@
15
15
  npm i @putout/plugin-for-of
16
16
  ```
17
17
 
18
+ ## Rules
19
+
20
+ - ✅ [for-each](#for-each);
21
+ - ✅ [for-entries](#for-entries);
22
+ - ✅ [for-entries-n](#for-entries-n);
23
+ - ✅ [for-in-negative](#for-in-negative);
24
+ - ✅ [for-in-positive](#for-in-positive);
25
+ - ✅ [for-length](#for-length);
26
+ - ✅ [for-n](#for-n);
27
+ - ✅ [map](#map);
28
+ - ✅ [reduce](#reduce);
29
+ - ✅ [remove-unused-variables](#remove-unused-variables);
30
+ - ✅ [remove-useless](#remove-useless);
31
+ - ✅ [remove-useless-array-from](#remove-useless-array-from);
32
+ - ✅ [remove-useless-variables](#remove-useless-variables);
33
+
18
34
  ## Configuration
19
35
 
20
36
  ```json
@@ -78,7 +78,15 @@ module.exports.replace = () => ({
78
78
 
79
79
  module.exports.match = () => ({
80
80
  '__.forEach(__args)': (vars, path) => {
81
- if (path.parentPath.isSequenceExpression())
81
+ const {parentPath} = path;
82
+
83
+ if (parentPath.isSequenceExpression())
84
+ return false;
85
+
86
+ if (parentPath.isConditionalExpression())
87
+ return false;
88
+
89
+ if (parentPath.isVariableDeclarator())
82
90
  return false;
83
91
 
84
92
  const objectPath = path.get('callee.object');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-for-of",
3
- "version": "4.0.0",
3
+ "version": "5.0.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,10 +40,10 @@
40
40
  "@putout/plugin-remove-unused-variables": "*",
41
41
  "@putout/plugin-remove-useless-arguments": "*",
42
42
  "@putout/plugin-remove-useless-continue": "*",
43
- "@putout/test": "^8.0.0",
43
+ "@putout/test": "^9.0.0",
44
44
  "c8": "^9.0.0",
45
- "eslint": "^9.0.0-alpha.0",
46
- "eslint-plugin-n": "^16.0.0",
45
+ "eslint": "^9.0.0",
46
+ "eslint-plugin-n": "^17.0.0",
47
47
  "eslint-plugin-putout": "^22.0.0",
48
48
  "lerna": "^6.0.1",
49
49
  "madrun": "^10.0.0",
@@ -51,7 +51,7 @@
51
51
  "nodemon": "^3.0.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "putout": ">=34"
54
+ "putout": ">=35"
55
55
  },
56
56
  "license": "MIT",
57
57
  "engines": {