radian-software / apheleia

🌷 Run code formatter on buffer contents without moving point, using RCS patches and dynamic programming.
MIT License
558 stars 75 forks source link

Not picking up prettier installed via yarn pnp properly when using melpa package #244

Closed edslocomb closed 11 months ago

edslocomb commented 11 months ago

I'm seeing a weird thing where the pnp install isn't picked up if I start emacs in the project root, but it works if I start emacs one directory closer to the file being edited.

afaict this is due to the apheleia-npx script not knowing where the file to be formatted is (buffer contents are piped to it so apheleia can work when there's no filename associated with the buffer)

I'm thinking the thing to do here is rewrite apheleia-npx as an elisp function; I'll tinker a bit and put a PR in if it works well

edslocomb commented 11 months ago

OK now I can't repo the behavior, closing.

raxod502 commented 11 months ago

The filename shouldn't matter, as apheleia-npx works based on working directory, which should always be set.