Skip to content
New issue

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

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

Already on GitHub? # to your account

bug: The import statements are ordered when enabling the prettier formatter #599

Open
GiancarlosIO opened this issue Sep 1, 2023 · 1 comment

Comments

@GiancarlosIO
Copy link

GiancarlosIO commented Sep 1, 2023

Neovim version (nvim -v)

0.9.1

Operating system/version

Macos 12.5.1

Describe the bug

Hi there!
This is my first time using neovim and lazyvim. There I'm enabling prettierd and I found that all my import statements are being ordered on save-file 😢

prettier-neovim.mp4

This only happens with lazyvim and prettierd enabled. I have tested my code and prettier config in vscode and in the command line (prettier --write.. ) and it works as expected. Maybe the prettierd plugin has a default configuration that is overridden my prettier.config.js? 🤔

Steps To Reproduce

  1. Install lazy vim: https://www.lazyvim.org/installation
  2. Enable prettier: https://www.lazyvim.org/extras/formatting/prettier
  3. Go to a ts file and save the file. You will see how the imports are sorted 😞

Expected Behavior

Prettier should not sort/order my imports 😢

I have created the issue in the lazyvim repo but looks like they doesn't apply any custom configuration. So, looks like the problem is with prettierd 🤔
LazyVim/LazyVim#1396

Also, is there a way to enable bugs and get the logs of prettierd? 🤔

@fsouza
Copy link
Owner

fsouza commented Sep 1, 2023

Are you able to reproduce it without lazyvim?

cat prettier-bug.tsx | prettierd prettier-bug.tsx

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants