@putout/plugin-putout 11.12.0 → 11.13.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.
|
@@ -18,7 +18,7 @@ module.exports.match = () => ({
|
|
|
18
18
|
if (withFix)
|
|
19
19
|
return false;
|
|
20
20
|
|
|
21
|
-
if (
|
|
21
|
+
if (check(path))
|
|
22
22
|
return false;
|
|
23
23
|
|
|
24
24
|
if (!__args.length)
|
|
@@ -39,16 +39,29 @@ module.exports.replace = () => ({
|
|
|
39
39
|
'module.exports.traverse = (__args) => __a': 'module.exports.replace = (__args) => __a',
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
function
|
|
43
|
-
let
|
|
42
|
+
function check(path) {
|
|
43
|
+
let hasPushCall = false;
|
|
44
|
+
let hasTraverseMethod = false;
|
|
44
45
|
|
|
45
46
|
traverse(path, {
|
|
47
|
+
'ObjectMethod|ObjectProperty': (path) => {
|
|
48
|
+
const keyPath = path.get('key');
|
|
49
|
+
|
|
50
|
+
if (!path.parentPath.isObjectExpression())
|
|
51
|
+
return;
|
|
52
|
+
|
|
53
|
+
if (!keyPath.isIdentifier())
|
|
54
|
+
return;
|
|
55
|
+
|
|
56
|
+
hasTraverseMethod = true;
|
|
57
|
+
path.stop();
|
|
58
|
+
},
|
|
46
59
|
'push(__a)': (path) => {
|
|
47
|
-
|
|
60
|
+
hasPushCall = true;
|
|
48
61
|
path.stop();
|
|
49
62
|
},
|
|
50
63
|
});
|
|
51
64
|
|
|
52
|
-
return
|
|
65
|
+
return hasPushCall || hasTraverseMethod;
|
|
53
66
|
}
|
|
54
67
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-putout",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.13.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout plugin helps with plugins development",
|
|
7
7
|
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-putout#readme",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
|
+
"commitType": "colon",
|
|
9
10
|
"release": false,
|
|
10
11
|
"tag": false,
|
|
11
12
|
"changelog": false,
|