Skip to content

Add arrowFunction.noNewLineBeforeFnCall option - #528

Closed
Ty3uK wants to merge 3 commits into
dprint:mainfrom
Ty3uK:feature/arrow_expression_no_new_line_after_fn_call
Closed

Ty3uK wants to merge 3 commits into
dprint:mainfrom
Ty3uK:feature/arrow_expression_no_new_line_after_fn_call

Conversation

@Ty3uK

@Ty3uK Ty3uK commented May 25, 2023 •

Copy link
Copy Markdown
Contributor

Resolves #107.

If set to true dprint will not format this:

[].map(() => test({
    foo: 1,
    bar: 2,
}));

to this:

[].map(() =>
    test({
        foo: 1,
        bar: 2,
    })
);

and this:

const getStyles = () => css`
    display: flex;
`;

to this:

const getStyles = () =>
    css`
    display: flex;
`;

@Ty3uK

Ty3uK commented May 25, 2023

Copy link
Copy Markdown
Contributor Author

Also, please help with naming, I'm not quite sure that noNewLineBeforeFnCall is ok 🙂

@Ty3uK
Ty3uK force-pushed the feature/arrow_expression_no_new_line_after_fn_call branch from f611613 to 26fafef Compare May 26, 2023 07:26
Resolves dprint#107.

If set to true dprint will not format this:

```typescript
[].map(() => test({
    foo: 1,
    bar: 2,
}));
````

to this:

```typescript
[].map(() =>
    test({
        foo: 1,
        bar: 2,
    })
);
```
@Ty3uK
Ty3uK force-pushed the feature/arrow_expression_no_new_line_after_fn_call branch from 26fafef to cb89919 Compare May 26, 2023 07:27
@Ty3uK

Ty3uK commented May 31, 2023

Copy link
Copy Markdown
Contributor Author

@dsherret, may I ask you to check this PR? 🙂

@dsherret

dsherret commented Nov 3, 2026

Copy link
Copy Markdown
Member

Thanks, but doing this by default in #861

@dsherret dsherret closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-line arrow-function expression body should not add line break after arrow in certain circumstances

2 participants