Created
October 28, 2020 04:58
-
-
Save shikishima/96af9358ca5272b96e9cfc99c8834c25 to your computer and use it in GitHub Desktop.
tramp-modeでサーバー上のファイルでformat-allをかけた時、prettierの設定ファイルを使う
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (advice-add 'format-all--buffer-easy :around #'tt/format-all/prettier-config) | |
| (defun tt/format-all/prettier-config (orig executable &rest args) | |
| ;; tramp-modeでprettier使用時にローカルのconfigを読み込ませる | |
| (when (and (string-match "prettier" executable) (tramp-tramp-file-p (buffer-file-name))) | |
| (setq args (append (list "--config" (tt/nice-path "~/.prettierrc")) args)) | |
| (apply orig executable args) | |
| )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment