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

Comments in array: idempotence violation and change of order #10108

Closed
thorn0 opened this issue Jan 23, 2021 · 1 comment
Closed

Comments in array: idempotence violation and change of order #10108

thorn0 opened this issue Jan 23, 2021 · 1 comment
Labels
area:comments Issues with how Prettier prints comments area:idempotency Issues with re-printing Prettier’s output lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program

Comments

@thorn0
Copy link
Member

thorn0 commented Jan 23, 2021

Prettier 2.2.1
Playground link

--parser babel

Input:

const lazyCatererNumbers = [
  1, 2, 4, 7, 11, 16, 22, 29, 37, 45, /* ...
  */ // n > 10
  56, 67
];

Output:

const lazyCatererNumbers = [
  1,
  2,
  4,
  7,
  11,
  16,
  22,
  29,
  37,
  45
  /* ...
   */, // n > 10
  56,
  67,
];

Second Output:

const lazyCatererNumbers = [
  1,
  2,
  4,
  7,
  11,
  16,
  22,
  29,
  37,
  45, // n > 10
  /* ...
   */ 56,
  67,
];
@thorn0 thorn0 added area:comments Issues with how Prettier prints comments area:idempotency Issues with re-printing Prettier’s output lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program labels Jan 23, 2021
@thorn0
Copy link
Member Author

thorn0 commented Sep 15, 2022

Fixed by #13438

Prettier pr-13438
Playground link

--parser babel

Input:

const lazyCatererNumbers = [
  1, 2, 4, 7, 11, 16, 22, 29, 37, 45, /* ...
  */ // n > 10
  56, 67
];

Output:

const lazyCatererNumbers = [
  1,
  2,
  4,
  7,
  11,
  16,
  22,
  29,
  37,
  45 /* ...
   */, // n > 10
  56,
  67,
];

@thorn0 thorn0 closed this as completed Sep 15, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:comments Issues with how Prettier prints comments area:idempotency Issues with re-printing Prettier’s output lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

1 participant