@putout/printer 7.0.0 → 7.1.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 +18 -0
- package/lib/tokenize/comment/parse-leading-comments.js +1 -3
- package/lib/tokenize/expressions/import-expression.js +9 -0
- package/lib/tokenize/expressions/index.js +2 -0
- package/lib/tokenize/literals/index.js +0 -3
- package/lib/tokenize/tokenize.js +1 -1
- package/package.json +7 -7
package/ChangeLog
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
2023.12.12, v7.1.1
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- feefbe7 @putout/printer: rm useless comment deduplicate
|
|
5
|
+
|
|
6
|
+
2023.12.11, v7.1.0
|
|
7
|
+
|
|
8
|
+
fix:
|
|
9
|
+
- 0bab268 @putout/printer: tokenize: node check
|
|
10
|
+
- 6731f76 @putout/printer: tokenize: node check
|
|
11
|
+
|
|
12
|
+
feature:
|
|
13
|
+
- 43bee61 @putout/printer: ImportExpression: add
|
|
14
|
+
- c718594 @putout/printer: @putout/operate v12.0.0
|
|
15
|
+
- 11aed5c @putout/printer: typescript v5.3.3
|
|
16
|
+
- ce15416 @putout/printer: supertape v9.0.0
|
|
17
|
+
- df59fe3 @putout/printer: eslint-plugin-putout v22.0.0
|
|
18
|
+
|
|
1
19
|
2023.12.10, v7.0.0
|
|
2
20
|
|
|
3
21
|
feature:
|
|
@@ -10,8 +10,6 @@ const {
|
|
|
10
10
|
const {markBefore} = require('../mark');
|
|
11
11
|
const {maybeInsideFn} = require('./maybe-inside-fn');
|
|
12
12
|
|
|
13
|
-
const deduplicate = (a) => Array.from(new Set(a));
|
|
14
|
-
|
|
15
13
|
const {
|
|
16
14
|
isObjectProperty,
|
|
17
15
|
isVariableDeclarator,
|
|
@@ -74,7 +72,7 @@ module.exports.parseLeadingComments = (path, {print, maybe, indent}, semantics)
|
|
|
74
72
|
const propIs = isProperty(path);
|
|
75
73
|
const isIndent = isFirst(path) || !looksLikeSwitchCase && !path.isClassMethod() && !insideFn && !propIs;
|
|
76
74
|
|
|
77
|
-
for (const {type, value} of
|
|
75
|
+
for (const {type, value} of leadingComments) {
|
|
78
76
|
maybe.indent(isIndent);
|
|
79
77
|
|
|
80
78
|
if (type === 'CommentLine') {
|
|
@@ -45,6 +45,7 @@ const {ConditionalExpression} = require('./conditional-expression');
|
|
|
45
45
|
const {StaticBlock} = require('./class/static-block');
|
|
46
46
|
const {RecordExpression} = require('./object-expression/record-expression');
|
|
47
47
|
const {TupleExpression} = require('./array-expression/tuple-expression');
|
|
48
|
+
const {ImportExpression} = require('./import-expression');
|
|
48
49
|
|
|
49
50
|
module.exports = {
|
|
50
51
|
...functions,
|
|
@@ -70,6 +71,7 @@ module.exports = {
|
|
|
70
71
|
ObjectPattern,
|
|
71
72
|
PrivateName,
|
|
72
73
|
RestElement,
|
|
74
|
+
ImportExpression,
|
|
73
75
|
SpreadElement,
|
|
74
76
|
SequenceExpression,
|
|
75
77
|
StaticBlock,
|
package/lib/tokenize/tokenize.js
CHANGED
|
@@ -229,7 +229,7 @@ module.exports.tokenize = (ast, overrides) => {
|
|
|
229
229
|
print: maybePrint,
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
-
maybeThrow(!currentTraverse, path, `☝️Node type '{{ type }}' is not supported yet by @putout/printer: '{{ path }}'`);
|
|
232
|
+
maybeThrow(!currentTraverse, path, `☝️ Node type '{{ type }}' is not supported yet by @putout/printer: '{{ path }}'`);
|
|
233
233
|
|
|
234
234
|
const currentIndent = i;
|
|
235
235
|
parseLeadingComments(path, printer, semantics);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/printer",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Simplest possible opinionated Babel AST printer for 🐊Putout",
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"url": "git://github.com/putoutjs/printer.git"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"wisdom": "madrun wisdom",
|
|
18
17
|
"test": "madrun test",
|
|
19
18
|
"test:dts": "madrun test:dts",
|
|
20
19
|
"watch:test": "madrun watch:test",
|
|
@@ -27,9 +26,9 @@
|
|
|
27
26
|
"report": "madrun report"
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|
|
30
|
-
"@putout/babel": "^
|
|
29
|
+
"@putout/babel": "^2.0.0",
|
|
31
30
|
"@putout/compare": "^14.0.0",
|
|
32
|
-
"@putout/operate": "^
|
|
31
|
+
"@putout/operate": "^12.0.0",
|
|
33
32
|
"@putout/operator-json": "^1.2.0",
|
|
34
33
|
"fullstore": "^3.0.0",
|
|
35
34
|
"just-snake-case": "^3.2.0",
|
|
@@ -58,7 +57,7 @@
|
|
|
58
57
|
"escover": "^4.0.1",
|
|
59
58
|
"eslint": "^8.0.1",
|
|
60
59
|
"eslint-plugin-n": "^16.0.0",
|
|
61
|
-
"eslint-plugin-putout": "^
|
|
60
|
+
"eslint-plugin-putout": "^22.0.0",
|
|
62
61
|
"estree-to-babel": "^8.0.0",
|
|
63
62
|
"just-kebab-case": "^4.2.0",
|
|
64
63
|
"madrun": "^10.0.0",
|
|
@@ -66,8 +65,9 @@
|
|
|
66
65
|
"montag": "^1.0.0",
|
|
67
66
|
"nodemon": "^3.0.1",
|
|
68
67
|
"putout": "^34.0.0",
|
|
69
|
-
"supertape": "^
|
|
70
|
-
"try-catch": "^3.0.0"
|
|
68
|
+
"supertape": "^9.0.0",
|
|
69
|
+
"try-catch": "^3.0.0",
|
|
70
|
+
"typescript": "^5.3.3"
|
|
71
71
|
},
|
|
72
72
|
"license": "MIT",
|
|
73
73
|
"engines": {
|