fsouza / prettierd

prettier, as a daemon, for improved formatting speed.
ISC License
812 stars 24 forks source link

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

Open GiancarlosIO opened 1 year ago

GiancarlosIO commented 1 year ago

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 😢

https://github.com/LazyVim/LazyVim/assets/17274950/8f0479a1-0ea5-4e66-87f7-1eddfb3efc55

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 🤔 https://github.com/LazyVim/LazyVim/issues/1396

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

fsouza commented 1 year ago

Are you able to reproduce it without lazyvim?

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