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

Error: Found comma but its following sibling is not a line: undefined #42

Open
u3u opened this issue Aug 5, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@u3u
Copy link

u3u commented Aug 5, 2024

const arr = [
  1,
  // 2,
  3,
];

When commenting on the item in the middle of the array, an error will occur during formatting:

Error: Found comma but its following sibling is not a line: undefined
    at prettier-plugin-multiline-arrays/dist/printer/insert-new-lines.js:234:39
@electrovir electrovir added the bug Something isn't working label Aug 5, 2024
@electrovir electrovir self-assigned this Aug 5, 2024
@electrovir
Copy link
Owner

Thanks for the report! I'll take a look.

@Alex-Sokolov
Copy link

Alex-Sokolov commented Sep 2, 2024

Same too :) looks like plugin will fail when there is comment inside array
SCR-20240902-qjdh
SCR-20240902-qjrb

Sometimes errors message a little different:
image

"prettier": "3.3.3",
"prettier-plugin-multiline-arrays": "3.0.6",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants