@putout/plugin-putout 27.12.0 β 28.0.1
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
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import {operator} from 'putout';
|
|
2
|
+
import regexpEscapePolifyll from 'regexp.escape';
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
escape: regexpEscape = regexpEscapePolifyll,
|
|
6
|
+
} = RegExp;
|
|
2
7
|
|
|
3
8
|
const {
|
|
4
9
|
setLiteralValue,
|
|
@@ -73,8 +78,10 @@ const check = ({__a}, path) => {
|
|
|
73
78
|
if (name.includes(')'))
|
|
74
79
|
return false;
|
|
75
80
|
|
|
76
|
-
const
|
|
77
|
-
|
|
81
|
+
const safeName = regexpEscape(name);
|
|
82
|
+
|
|
83
|
+
const regEnd = RegExp(`: ${safeName}$`);
|
|
84
|
+
const regMiddle = RegExp(`: ${safeName}: .*`);
|
|
78
85
|
|
|
79
86
|
return !regEnd.test(value) && !regMiddle.test(value);
|
|
80
87
|
};
|
|
@@ -110,5 +117,7 @@ const getTestNodeArgument = (path) => {
|
|
|
110
117
|
if (testPath.isExpressionStatement())
|
|
111
118
|
testPath = testPath.get('expression');
|
|
112
119
|
|
|
113
|
-
|
|
120
|
+
const [first] = testPath.node.arguments;
|
|
121
|
+
|
|
122
|
+
return first;
|
|
114
123
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "28.0.1",
|
|
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",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"fullstore": "^3.0.0",
|
|
35
35
|
"just-camel-case": "^6.2.0",
|
|
36
36
|
"just-kebab-case": "^4.2.0",
|
|
37
|
+
"regexp.escape": "^2.0.1",
|
|
37
38
|
"try-catch": "^3.0.0"
|
|
38
39
|
},
|
|
39
40
|
"keywords": [
|
|
@@ -44,21 +45,21 @@
|
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@putout/eslint-flat": "^3.0.0",
|
|
46
47
|
"@putout/plugin-esm": "*",
|
|
47
|
-
"@putout/plugin-
|
|
48
|
+
"@putout/plugin-destructuring": "*",
|
|
48
49
|
"@putout/plugin-nodejs": "*",
|
|
49
50
|
"@putout/plugin-tape": "*",
|
|
50
51
|
"@putout/test": "^14.0.0",
|
|
51
52
|
"c8": "^10.0.0",
|
|
52
|
-
"eslint": "^
|
|
53
|
+
"eslint": "^10.0.0-alpha.0",
|
|
53
54
|
"eslint-plugin-n": "^17.0.0",
|
|
54
|
-
"eslint-plugin-putout": "^
|
|
55
|
+
"eslint-plugin-putout": "^29.0.0",
|
|
55
56
|
"madrun": "^11.0.0",
|
|
56
57
|
"montag": "^1.2.1",
|
|
57
58
|
"nodemon": "^3.0.1",
|
|
58
59
|
"supertape": "^11.0.3"
|
|
59
60
|
},
|
|
60
61
|
"peerDependencies": {
|
|
61
|
-
"putout": ">=
|
|
62
|
+
"putout": ">=41"
|
|
62
63
|
},
|
|
63
64
|
"license": "MIT",
|
|
64
65
|
"engines": {
|