@putout/plugin-putout 27.11.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
|
|
@@ -24,6 +24,7 @@ export const report = () => `Apply 'fixture' name to 'message'`;
|
|
|
24
24
|
|
|
25
25
|
export const match = () => ({
|
|
26
26
|
't.noReport(__a)': check,
|
|
27
|
+
't.noReport(__a, __b)': check,
|
|
27
28
|
't.noReportAfterTransform(__a)': check,
|
|
28
29
|
't.report(__a, __b)': check,
|
|
29
30
|
't.transform(__a)': check,
|
|
@@ -36,6 +37,7 @@ export const match = () => ({
|
|
|
36
37
|
|
|
37
38
|
export const replace = () => ({
|
|
38
39
|
't.noReport(__a)': transform,
|
|
40
|
+
't.noReport(__a, __b)': transform,
|
|
39
41
|
't.report(__a, __b)': transform,
|
|
40
42
|
't.transform(__a)': transform,
|
|
41
43
|
't.transform(__a, __b)': transform,
|
|
@@ -71,8 +73,10 @@ const check = ({__a}, path) => {
|
|
|
71
73
|
if (name.includes(')'))
|
|
72
74
|
return false;
|
|
73
75
|
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
+
const safeName = RegExp.escape(name);
|
|
77
|
+
|
|
78
|
+
const regEnd = RegExp(`: ${safeName}$`);
|
|
79
|
+
const regMiddle = RegExp(`: ${safeName}: .*`);
|
|
76
80
|
|
|
77
81
|
return !regEnd.test(value) && !regMiddle.test(value);
|
|
78
82
|
};
|
|
@@ -108,5 +112,8 @@ const getTestNodeArgument = (path) => {
|
|
|
108
112
|
if (testPath.isExpressionStatement())
|
|
109
113
|
testPath = testPath.get('expression');
|
|
110
114
|
|
|
111
|
-
|
|
115
|
+
const [first] = testPath.node.arguments;
|
|
116
|
+
|
|
117
|
+
return first;
|
|
112
118
|
};
|
|
119
|
+
|
|
@@ -59,6 +59,11 @@ export const traverse = ({push}) => ({
|
|
|
59
59
|
incorrect: INCORRECT.NO_REPORT,
|
|
60
60
|
correct: ': no report',
|
|
61
61
|
}),
|
|
62
|
+
't.noReport(__a, __b)': convert({
|
|
63
|
+
push,
|
|
64
|
+
incorrect: INCORRECT.NO_REPORT,
|
|
65
|
+
correct: ': no report',
|
|
66
|
+
}),
|
|
62
67
|
't.noReportAfterTransform(__a)': convert({
|
|
63
68
|
push,
|
|
64
69
|
incorrect: INCORRECT.NO_REPORT_AFTER_TRANSFORM,
|
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": {
|