@putout/printer 18.9.2 → 18.10.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/ChangeLog
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
2026.04.14, v18.10.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 85c0371d @putout/printer: ArrayExpression: long-lines
|
|
5
|
+
|
|
6
|
+
2026.04.03, v18.9.3
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- af4396ca @putout/printer: BinaryExpression: inside ReturnStatement
|
|
10
|
+
- a3aea18c @putout/printer: BinaryExpression: inside ReturnStatement
|
|
11
|
+
- 08dda337 @putout/printer: typescript v6.0.2
|
|
12
|
+
- 16455973 @putout/printer: check-dts v1.0.0
|
|
13
|
+
|
|
1
14
|
2026.03.21, v18.9.2
|
|
2
15
|
|
|
3
16
|
feature:
|
|
@@ -148,6 +148,18 @@ const isMoreThenMaxLiteralLength = (path, {maxElementLengthInOneLine}) => {
|
|
|
148
148
|
return false;
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
+
const isTripleMoreThenMaxLiteralLength = (path, {maxElementLengthInOneLine}) => {
|
|
152
|
+
const {elements} = path.node;
|
|
153
|
+
const max = maxElementLengthInOneLine * 3;
|
|
154
|
+
|
|
155
|
+
for (const element of elements.filter(isStringLiteral)) {
|
|
156
|
+
if (element.value.length >= max)
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return false;
|
|
161
|
+
};
|
|
162
|
+
|
|
151
163
|
const isMoreThenMaxIdentifierLength = (path, {maxElementLengthInOneLine}) => {
|
|
152
164
|
const [first] = path.node.elements;
|
|
153
165
|
|
|
@@ -166,6 +178,7 @@ const hasObjects = (path) => {
|
|
|
166
178
|
|
|
167
179
|
const isMoreThenMaxElementLengthInOneLine = createTypeChecker([
|
|
168
180
|
['-: node.elements.length', '<', 2],
|
|
181
|
+
['+', isTripleMoreThenMaxLiteralLength],
|
|
169
182
|
['-: -> !', isInsideCall],
|
|
170
183
|
['-', hasObjects],
|
|
171
184
|
['+', isMoreThenMaxLiteralLength],
|
|
@@ -3,6 +3,7 @@ import {createTypeChecker} from '#type-checker';
|
|
|
3
3
|
const isPlus = (a) => a === '+';
|
|
4
4
|
|
|
5
5
|
export const isConcatenation = createTypeChecker([
|
|
6
|
+
['-: parentPath -> ReturnStatement'],
|
|
6
7
|
['-: node.operator -> !', isPlus],
|
|
7
8
|
['-: node.loc', isSameLine],
|
|
8
9
|
['+: BinaryExpression'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/printer",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Simplest possible opinionated Babel AST printer for 🐊Putout",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@supertape/operator-strip": "^1.0.0",
|
|
88
88
|
"acorn": "^8.8.2",
|
|
89
89
|
"chalk": "^5.6.2",
|
|
90
|
-
"check-dts": "^0.
|
|
90
|
+
"check-dts": "^1.0.0",
|
|
91
91
|
"escover": "^6.0.0",
|
|
92
92
|
"eslint": "^10.0.0",
|
|
93
93
|
"eslint-plugin-putout": "^31.0.0",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"superc8": "^12.2.4",
|
|
104
104
|
"supertape": "^12.0.9",
|
|
105
105
|
"try-catch": "^4.0.6",
|
|
106
|
-
"typescript": "^
|
|
106
|
+
"typescript": "^6.0.2"
|
|
107
107
|
},
|
|
108
108
|
"license": "MIT",
|
|
109
109
|
"engines": {
|