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

improve formatting between long function param and long type param #565

Open
brodycj opened this issue Jun 7, 2021 · 2 comments
Open

improve formatting between long function param and long type param #565

brodycj opened this issue Jun 7, 2021 · 2 comments
Labels
enhancement New feature or request needs-discussion

Comments

@brodycj
Copy link
Owner

brodycj commented Jun 7, 2021

prettier/prettier#11032

Prettier 2.2.1
Playground link

--parser babel

Input:

const LongVar = LongLongLongLongLongFun(param, { 
  key1: "value1"
});

type LongType = LongLongLongLongLongLongType<Param, {
  key1: Value1,
}>

Output:

const LongVar = LongLongLongLongLongFun(param, {
  key1: "value1",
});

type LongType = LongLongLongLongLongLongType<
  Param,
  {
    key1: Value1,
  }
>;

Expected behavior:

The output should be same as input I think.

const LongVar = LongLongLongLongLongFun(param, { 
  key1: "value1"
});

type LongType = LongLongLongLongLongLongType<Param, {
  key1: Value1,
}>
@brodycj brodycj added enhancement New feature or request needs-discussion labels Jun 7, 2021
@kbrilla
Copy link

kbrilla commented Jul 8, 2021

image
same happens in class declarations and it really looks bad
Happens after upgrade form 2.2.1 -> 2.3.2

@brodycj
Copy link
Owner Author

brodycj commented Jul 8, 2021

same happens in class declarations and it really looks bad

prettier/prettier#11032 (comment)

Shouldn't this be part of issue #444?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-discussion
Projects
None yet
Development

No branches or pull requests

2 participants