MunifTanjim / prettier.nvim

Prettier plugin for Neovim's built-in LSP client.
MIT License
289 stars 9 forks source link

Not loading options? #5

Closed omar2205 closed 2 years ago

omar2205 commented 2 years ago

I have this config. When I format it doesn't format according to these options

image

MunifTanjim commented 2 years ago

It's working for me tho. By the way, if you set options this way, it will always override the options you set in your config file. So you might want to not set options in the prettier.setup(...) function and put a config file (e.g. .prettierrc.json or .prettierrc.js) in your project's root directory.

Also are you sure prettier is formatting your file? Can you try running the :Prettier command in neovim to see if that works?

omar2205 commented 2 years ago

I copied the example in the readme. I have set a message to pop after formatting.

MunifTanjim commented 2 years ago

If you're also using tsserver or something similar, those might be handling the formatting. Check this: https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Avoiding-LSP-formatting-conflicts

This is how I'm doing it in my config: