@putout/plugin-for-of 2.0.0 → 3.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 +1 -1
- package/lib/for-each/index.js +1 -1
- package/lib/index.js +26 -16
- package/package.json +4 -4
package/README.md
CHANGED
package/lib/for-each/index.js
CHANGED
|
@@ -30,7 +30,7 @@ const forOfEntriesTemplate = template(`
|
|
|
30
30
|
const {keys} = Object;
|
|
31
31
|
const isRoot = (path) => path.isFunction() || path.isProgram();
|
|
32
32
|
|
|
33
|
-
module.exports.report = () => `for-of
|
|
33
|
+
module.exports.report = () => `Use 'for-of' instead of 'forEach()'`;
|
|
34
34
|
|
|
35
35
|
module.exports.replace = () => ({
|
|
36
36
|
'__.forEach.call(__a, (__b) => __body)': 'for (const __b of __a) __body',
|
package/lib/index.js
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const map = require('./map');
|
|
4
|
+
const forEach = require('./for-each');
|
|
5
|
+
const forN = require('./for-n');
|
|
6
|
+
const forLength = require('./for-length');
|
|
7
|
+
const forEntries = require('./for-entries');
|
|
8
|
+
const forEntriesN = require('./for-entries-n');
|
|
9
|
+
const forInNegative = require('./for-in-negative');
|
|
10
|
+
const forInPositive = require('./for-in-positive');
|
|
11
|
+
const reduce = require('./reduce');
|
|
12
|
+
const removeUseless = require('./remove-useless');
|
|
13
|
+
const removeUselessVariables = require('./remove-useless-variables');
|
|
14
|
+
const removeUselessArrayFrom = require('./remove-useless-array-from');
|
|
15
|
+
const removeUnusedVariables = require('./remove-unused-variables');
|
|
6
16
|
|
|
7
17
|
module.exports.rules = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
map,
|
|
19
|
+
'for-each': forEach,
|
|
20
|
+
'for-n': forN,
|
|
21
|
+
'for-length': forLength,
|
|
22
|
+
'for-entries': forEntries,
|
|
23
|
+
'for-entries-n': forEntriesN,
|
|
24
|
+
'for-in-negative': forInNegative,
|
|
25
|
+
'for-in-positive': forInPositive,
|
|
26
|
+
reduce,
|
|
27
|
+
'remove-useless': removeUseless,
|
|
28
|
+
'remove-useless-variables': removeUselessVariables,
|
|
29
|
+
'remove-useless-array-from': removeUselessArrayFrom,
|
|
30
|
+
'remove-unused-variables': removeUnusedVariables,
|
|
21
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-for-of",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.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",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"c8": "^8.0.0",
|
|
45
45
|
"eslint": "^8.0.1",
|
|
46
46
|
"eslint-plugin-n": "^16.0.0",
|
|
47
|
-
"eslint-plugin-putout": "^
|
|
47
|
+
"eslint-plugin-putout": "^19.0.0",
|
|
48
48
|
"lerna": "^6.0.1",
|
|
49
49
|
"madrun": "^9.0.0",
|
|
50
50
|
"montag": "^1.2.1",
|
|
51
|
-
"nodemon": "^
|
|
51
|
+
"nodemon": "^3.0.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"putout": ">=
|
|
54
|
+
"putout": ">=31"
|
|
55
55
|
},
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"engines": {
|