@putout/plugin-putout 27.12.0 β 28.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
|
@@ -1635,9 +1635,7 @@ Checkout in π[**Putout Editor**](https://putout.cloudcmd.io/#/gist/38336fcc5b
|
|
|
1635
1635
|
### β Example of incorrect code
|
|
1636
1636
|
|
|
1637
1637
|
```js
|
|
1638
|
-
module.exports.rules =
|
|
1639
|
-
...getRule('remove-unused-variables'),
|
|
1640
|
-
};
|
|
1638
|
+
module.exports.rules = getRule('remove-unused-variables');
|
|
1641
1639
|
```
|
|
1642
1640
|
|
|
1643
1641
|
### β
Example of correct code
|
|
@@ -73,8 +73,10 @@ const check = ({__a}, path) => {
|
|
|
73
73
|
if (name.includes(')'))
|
|
74
74
|
return false;
|
|
75
75
|
|
|
76
|
-
const
|
|
77
|
-
|
|
76
|
+
const safeName = RegExp.escape(name);
|
|
77
|
+
|
|
78
|
+
const regEnd = RegExp(`: ${safeName}$`);
|
|
79
|
+
const regMiddle = RegExp(`: ${safeName}: .*`);
|
|
78
80
|
|
|
79
81
|
return !regEnd.test(value) && !regMiddle.test(value);
|
|
80
82
|
};
|
|
@@ -110,5 +112,8 @@ const getTestNodeArgument = (path) => {
|
|
|
110
112
|
if (testPath.isExpressionStatement())
|
|
111
113
|
testPath = testPath.get('expression');
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
const [first] = testPath.node.arguments;
|
|
116
|
+
|
|
117
|
+
return first;
|
|
114
118
|
};
|
|
119
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "28.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "πPutout plugin helps with plugins development",
|
|
@@ -44,21 +44,21 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@putout/eslint-flat": "^3.0.0",
|
|
46
46
|
"@putout/plugin-esm": "*",
|
|
47
|
-
"@putout/plugin-
|
|
47
|
+
"@putout/plugin-destructuring": "*",
|
|
48
48
|
"@putout/plugin-nodejs": "*",
|
|
49
49
|
"@putout/plugin-tape": "*",
|
|
50
50
|
"@putout/test": "^14.0.0",
|
|
51
51
|
"c8": "^10.0.0",
|
|
52
|
-
"eslint": "^
|
|
52
|
+
"eslint": "^10.0.0-alpha.0",
|
|
53
53
|
"eslint-plugin-n": "^17.0.0",
|
|
54
|
-
"eslint-plugin-putout": "^
|
|
54
|
+
"eslint-plugin-putout": "^29.0.0",
|
|
55
55
|
"madrun": "^11.0.0",
|
|
56
56
|
"montag": "^1.2.1",
|
|
57
57
|
"nodemon": "^3.0.1",
|
|
58
58
|
"supertape": "^11.0.3"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"putout": ">=
|
|
61
|
+
"putout": ">=41"
|
|
62
62
|
},
|
|
63
63
|
"license": "MIT",
|
|
64
64
|
"engines": {
|