Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: deno fmt doesn't format function arguments #23047

Closed
marvinhagemeister opened this issue Mar 23, 2024 · 2 comments
Closed

Bug: deno fmt doesn't format function arguments #23047

marvinhagemeister opened this issue Mar 23, 2024 · 2 comments
Labels
deno fmt Related to the "deno fmt" subcommand or dprint working as designed this is working as intended

Comments

@marvinhagemeister
Copy link
Contributor

Input code:

function foo(
  arg: string,
): string {
  return arg;
}

Formatted output:

function foo(
  arg: string,
): string {
  return arg;
}

Expected output:

function foo(arg: string): string {
  return arg;
}

Version: Deno 1.41.3

@marvinhagemeister marvinhagemeister added the deno fmt Related to the "deno fmt" subcommand or dprint label Mar 23, 2024
@bartlomieju
Copy link
Member

This is correct - deno fmt preserves these new lines on purpose. If you change the example to:

function foo(arg: string,
): string {
  return arg;
}

It will format as you expect.

@bartlomieju bartlomieju added the working as designed this is working as intended label Mar 24, 2024
@dsherret
Copy link
Member

Let's track this in #7868

@dsherret dsherret closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deno fmt Related to the "deno fmt" subcommand or dprint working as designed this is working as intended
Projects
None yet
Development

No branches or pull requests

3 participants