From 2e613cb37ad7209ced85d169a131b6936e51310b Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 18 Apr 2017 18:47:38 +0200 Subject: [PATCH] Add jestbrains filewatcher docs (#1310) --- editors/jetbrains/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/editors/jetbrains/README.md b/editors/jetbrains/README.md index 2b4bc2900..d02481b47 100644 --- a/editors/jetbrains/README.md +++ b/editors/jetbrains/README.md @@ -11,7 +11,7 @@ Go to *File | Settings | Tools | External Tools* for Windows and Linux or *WebSt * **Parameters** set `--write [other opts] $FilePathRelativeToProjectRoot$` * **Working directory** set `$ProjectFileDir$` -![Example](https://raw.githubusercontent.com/jlongster/prettier/master/editors/jetbrains/with-prettier.png) +![Example](https://raw.githubusercontent.com/prettier/prettier/master/editors/jetbrains/with-prettier.png) ### Process directories @@ -28,3 +28,13 @@ Go to *File | Settings | Tools | External Tools* for Windows and Linux or *WebSt Now when you setup **External Tool** I guess you want to add hotkey for it. Go to *File | Settings | Keymap* for Windows and Linux *WebStorm | Preferences | Keymap* and type external tool name in search box. See [this documentation](https://www.jetbrains.com/help/webstorm/configuring-keyboard-shortcuts.html) about configuring keyboard shortcuts. + +## Using File Watcher + +To automatically format using `prettier` on save, you can use a file watcher. + +Go to *File | Settings | Tools | File Watchers* for Windows and Linux or *WebStorm | Preferences | Tools | File Watchers* for OS X and click **+** to add a new tool. Let’s name it **Prettier**. + +* **Program** set the full path to a `prettier` executable, such as `/Users/developer/repo/jest/node_modules/.bin/prettier` (on OS X and Linux) or `C:/\Users\developer\repo\jest\node_modules\.bin\prettier.cmd` (on Windows). +* **Parameters** set `--write [other opts] $FilePath$` +* **Working directory** set `$ProjectFileDir$`