@putout/plugin-printer 8.23.0 → 8.23.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
|
@@ -25,9 +25,9 @@ npm i @putout/plugin-printer -D
|
|
|
25
25
|
- ✅ [apply-types](#apply-types);
|
|
26
26
|
- ✅ [check-type-passed-to-type-checker](#check-type-passed-to-type-checker);
|
|
27
27
|
- ✅ [check-if-success-possible-in-type-checker](#check-if-success-possible-in-type-checker);
|
|
28
|
-
- ✅ [merge-tuple-of-type-checker](#merge-tuple-of-type-checker);
|
|
29
28
|
- ✅ [declare](#declare);
|
|
30
29
|
- ✅ [declare-nearby](#declare-nearby);
|
|
30
|
+
- ✅ [merge-tuple-of-type-checker](#merge-tuple-of-type-checker);
|
|
31
31
|
- ✅ [remove-args](#remove-args);
|
|
32
32
|
- ✅ [remove-useless-maybe](#remove-useless-maybe);
|
|
33
33
|
- ✅ [remove-useless-print](#remove-useless-print);
|
|
@@ -42,11 +42,12 @@ export const traverse = ({push}) => ({
|
|
|
42
42
|
function createWhere(path) {
|
|
43
43
|
const {value} = path.node;
|
|
44
44
|
const where = [];
|
|
45
|
+
const hasNot = value.includes('!');
|
|
45
46
|
|
|
46
47
|
if (value.includes('-> ->'))
|
|
47
48
|
where.push('duplicate');
|
|
48
49
|
|
|
49
|
-
if (isInsideCompareTuple(path) && value.includes(' -> '))
|
|
50
|
+
if (!hasNot && isInsideCompareTuple(path) && value.includes(' -> '))
|
|
50
51
|
where.push('useless');
|
|
51
52
|
|
|
52
53
|
return where;
|
|
@@ -63,7 +64,7 @@ function removeArrow(value, where) {
|
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
function isInsideCompareTuple({parentPath}) {
|
|
66
|
-
if (!isArrayExpression(parentPath))
|
|
67
|
+
if (!isArrayExpression(parentPath.parentPath))
|
|
67
68
|
return false;
|
|
68
69
|
|
|
69
70
|
return parentPath.node.elements.length === 3;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-printer",
|
|
3
|
-
"version": "8.23.
|
|
3
|
+
"version": "8.23.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout plugin adds support of transformations for @putout/printer",
|