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

Unstable formatting of javascript method chains #16132

Open
jdmnd opened this issue Mar 1, 2024 · 1 comment
Open

Unstable formatting of javascript method chains #16132

jdmnd opened this issue Mar 1, 2024 · 1 comment
Labels
area:idempotency Issues with re-printing Prettier’s output area:member chains lang:javascript Issues affecting JS

Comments

@jdmnd
Copy link

jdmnd commented Mar 1, 2024

Prettier 3.2.5
Playground link

--parser babel

(also reproduced with the typescript parser)

Input:

const x = z.bar().foozle(null, { message: 'something something something something something' });

Output:

const x = z
  .bar()
  .foozle(null, {
    message: "something something something something something",
  });

Second Output:

const x = z.bar().foozle(null, {
  message: "something something something something something",
});

Expected output:

const x = z.bar().foozle(null, {
  message: "something something something something something",
});

Why?

The second output should be the same as the first.

This is a minimal reduction of a larger real code snippet.

@kachkaev
Copy link
Member

kachkaev commented Mar 5, 2024

Might be related to #15918. Thanks for reporting!

@kachkaev kachkaev added lang:javascript Issues affecting JS area:idempotency Issues with re-printing Prettier’s output area:member chains labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:idempotency Issues with re-printing Prettier’s output area:member chains lang:javascript Issues affecting JS
Projects
None yet
Development

No branches or pull requests

2 participants