Skip to content

Commit

Permalink
feature: @putout/printer: ArrayExpression: newline
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Jun 12, 2023
1 parent 617feb6 commit b2c8253
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const isShortTwoSimplesInsideCall = (path, short) => {
if (!parentPath.isCallExpression())
return false;

if (!isSimple(a) || !isSimple(b))
if (!isStringLiteral(a) || !isStringLiteral(b))
return false;

return length < short;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ test('printer: tokenizer: array-expression: tuple: string, string', (t) => {
t.end();
});

test('printer: tokenizer: array-expression: argument', (t) => {
t.print(fixture.arrayExpressionArgument);
t.end();
});

test('printer: tokenizer: statement: ArrayExpression: space', (t) => {
const ast = parse(fixture.arrayExpressionSpace);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const shouldBreakline = satisfy([
isNewlineBetweenSiblings,
isNotLastBody,
isStrictMode,
]);

0 comments on commit b2c8253

Please sign in to comment.