sachin-12 · 2022-02-08 00:39
Hi. I'm learning emacs since few days and I want to use my project's prettier.rc for editing jsx/js files. I am unable to find a solution after struggling for 2 days. I need help.
emoarmy · 2022-02-08 00:58
Are you saying you want to use prettier, from within Emacs, to format your file on save?
Or are you saying you're already using prettier-js in Emacs and it is not obeying your prettierrc file?
sachin-12 · 2022-02-08 01:27
I have installed prettier-js and it is not obeying my project's prettier.rc file. Should I add any config to .emacs file? I also tried add-node-to-path which seems to do it but doesn't work in my case. I'm using vanilla Emacs latest version on windows 10
emoarmy · 2022-02-08 02:24
Hmm ok, I run prettier-js on Linux so I am not sure how much I can help.
But I did notice that prettier-js on windows requires diff installed. Have you installed that?
https://github.com/prettier/prettier-emacs#installing-on-windows
Also you keep saying prettier.rc but looking at prettier docs, that doesn't seem to be a supported file name. Could that be the issue?
https://prettier.io/docs/en/configuration.html
sachin-12 · 2022-02-08 03:46
Thanks. Somehow adding this package [https://github.com/jscheid/prettier.el](https://github.com/jscheid/prettier.el) worked. Well atleast a good start for me.
emoarmy · 2022-02-08 04:36
Sorry I couldn't be more help, but glad you got it working in the end :)
sachin-12 · 2022-02-08 06:19
Thanks for the support. It matters :)