@putout/printer 1.144.0 → 1.145.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
|
@@ -18,6 +18,8 @@ const {isSimple} = require('@putout/operate');
|
|
|
18
18
|
const {
|
|
19
19
|
isCoupleLines,
|
|
20
20
|
isStringAndIdentifier,
|
|
21
|
+
isIdentifierAndString,
|
|
22
|
+
|
|
21
23
|
} = require('../is');
|
|
22
24
|
|
|
23
25
|
const isForOf = ({parentPath}) => parentPath.isForOfStatement();
|
|
@@ -261,6 +263,9 @@ function isNewlineBetweenElements(path, {elements}) {
|
|
|
261
263
|
if (isStringAndIdentifier(elements))
|
|
262
264
|
return false;
|
|
263
265
|
|
|
266
|
+
if (isIdentifierAndString(elements))
|
|
267
|
+
return false;
|
|
268
|
+
|
|
264
269
|
if (isSimpleAndObject(elements))
|
|
265
270
|
return false;
|
|
266
271
|
|
package/lib/tokenize/is.js
CHANGED
|
@@ -43,6 +43,7 @@ function isCoupleLines(path) {
|
|
|
43
43
|
|
|
44
44
|
module.exports.exists = (a) => a.node;
|
|
45
45
|
module.exports.isStringAndIdentifier = ([a, b]) => isStringLiteral(a) && isIdentifier(b);
|
|
46
|
+
module.exports.isIdentifierAndString = ([a, b]) => isIdentifier(a) && isStringLiteral(b);
|
|
46
47
|
|
|
47
48
|
const isIfOrStatement = (a) => isIfStatement(a) || isStatement(a);
|
|
48
49
|
const isForOfOrStatement = (a) => isForOfStatement(a) || isStatement(a);
|
package/lib/tokenize/tokenize.js
CHANGED
|
@@ -31,6 +31,7 @@ const {
|
|
|
31
31
|
parseLeadingComments,
|
|
32
32
|
parseTrailingComments,
|
|
33
33
|
} = require('./comments');
|
|
34
|
+
|
|
34
35
|
const {parseOverrides} = require('./overrides');
|
|
35
36
|
|
|
36
37
|
const isString = (a) => typeof a === 'string';
|
|
@@ -233,7 +234,6 @@ module.exports.tokenize = (ast, overrides) => {
|
|
|
233
234
|
|
|
234
235
|
const currentIndent = i;
|
|
235
236
|
parseLeadingComments(path, printer, format);
|
|
236
|
-
|
|
237
237
|
// this is main thing
|
|
238
238
|
maybePlugin(currentTraverse, path, printer, semantics);
|
|
239
239
|
parseTrailingComments(path, printer, format);
|
package/package.json
CHANGED