prettier / prettier-emacs

Minor mode to format JS code on file save
http://jlongster.com/A-Prettier-Formatter
372 stars 53 forks source link

How to play nice with Tramp-Mode #33

Open coyotespike opened 6 years ago

coyotespike commented 6 years ago

When I save a JS file edited via Tramp, this error pops up in a new buffer:

prettier errors:
[warn] Ignored unknown option: --ignore-path /sshx
[error] Invalid configuration file: ENOENT: no such file or directory, scandir '/sshx:<serverName>/path/to/file

It would be great either to disable Prettier for files in Tramp mode, or to make it work.

bhagany commented 6 years ago

I've solved this for my case using this small patch: https://github.com/prettier/prettier-emacs/pull/37. Example configuration is in the description. Hope that helps!