@putout/printer 1.7.0 → 1.7.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/ChangeLog +5 -0
- package/lib/tokenize/expressions/call-expression.js +1 -1
- package/lib/tokenize/expressions/class-declaration.js +1 -1
- package/lib/tokenize/expressions/functions.js +6 -6
- package/lib/tokenize/statements/if-statement.js +1 -1
- package/lib/tokenize/statements/try-statements.js +2 -2
- package/lib/tokenize/statements/variable-declaration.js +1 -1
- package/package.json +2 -1
- package/rules/putout-plugin-apply-computed-print/fixture/apply-computed-print-fix.js +2 -0
- package/rules/putout-plugin-apply-computed-print/fixture/apply-computed-print.js +2 -0
- package/rules/putout-plugin-apply-computed-print/index.js +11 -0
package/ChangeLog
CHANGED
|
@@ -23,7 +23,7 @@ function CallExpression(path, {indent, print, maybe}) {
|
|
|
23
23
|
if (isNewLineBefore(path) && !isMarkedParentBefore(path) && !hasPrevNewline(path.parentPath))
|
|
24
24
|
print.breakline();
|
|
25
25
|
|
|
26
|
-
print(
|
|
26
|
+
print('__callee');
|
|
27
27
|
print('(');
|
|
28
28
|
|
|
29
29
|
const args = path.get('arguments');
|
|
@@ -53,7 +53,7 @@ function ArrowFunctionExpression(path, {print, maybe}) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
module.exports.ObjectMethod = (path, {print}) => {
|
|
56
|
-
print(
|
|
56
|
+
print('__key');
|
|
57
57
|
print('(');
|
|
58
58
|
|
|
59
59
|
const params = path.get('params');
|
|
@@ -67,7 +67,7 @@ module.exports.ObjectMethod = (path, {print}) => {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
print(') ');
|
|
70
|
-
print(
|
|
70
|
+
print('__body');
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
module.exports.FunctionDeclaration = (path, {print, maybe}) => {
|
|
@@ -78,7 +78,7 @@ module.exports.FunctionDeclaration = (path, {print, maybe}) => {
|
|
|
78
78
|
|
|
79
79
|
maybe.print(async, 'async ');
|
|
80
80
|
print('function ');
|
|
81
|
-
print(
|
|
81
|
+
print('__id');
|
|
82
82
|
print('(');
|
|
83
83
|
|
|
84
84
|
const params = path.get('params');
|
|
@@ -92,11 +92,11 @@ module.exports.FunctionDeclaration = (path, {print, maybe}) => {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
print(') ');
|
|
95
|
-
print(
|
|
95
|
+
print('__body');
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
module.exports.ClassMethod = (path, {print}) => {
|
|
99
|
-
print(
|
|
99
|
+
print('__key');
|
|
100
100
|
print('(');
|
|
101
101
|
|
|
102
102
|
const params = path.get('params');
|
|
@@ -110,5 +110,5 @@ module.exports.ClassMethod = (path, {print}) => {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
print(') ');
|
|
113
|
-
print(
|
|
113
|
+
print('__body');
|
|
114
114
|
};
|
|
@@ -5,8 +5,8 @@ module.exports.TryStatement = (path, {print, maybe}) => {
|
|
|
5
5
|
const finalizer = path.get('finalizer');
|
|
6
6
|
|
|
7
7
|
print('try ');
|
|
8
|
-
print(
|
|
9
|
-
print(
|
|
8
|
+
print('__block');
|
|
9
|
+
print('__handler');
|
|
10
10
|
|
|
11
11
|
if (finalizer.node) {
|
|
12
12
|
print(' ');
|
|
@@ -27,7 +27,7 @@ module.exports.VariableDeclaration = (path, {maybe, print}) => {
|
|
|
27
27
|
|
|
28
28
|
maybe.indent(isParentBlock);
|
|
29
29
|
print(`${path.node.kind} `);
|
|
30
|
-
print(
|
|
30
|
+
print('__declarations.0.id');
|
|
31
31
|
|
|
32
32
|
const initPath = path.get('declarations.0.init');
|
|
33
33
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/printer",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Easiest possible opinionated Babel AST printer made with ❤️ to use in 🐊Putout",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"generate"
|
|
42
42
|
],
|
|
43
43
|
"devDependencies": {
|
|
44
|
+
"@putout/test": "^6.0.1",
|
|
44
45
|
"c8": "^7.5.0",
|
|
45
46
|
"eslint": "^8.0.1",
|
|
46
47
|
"eslint-plugin-n": "^15.2.4",
|