Add jestbrains filewatcher docs (#1310)

This commit is contained in:
Simen Bekkhus authored and Christopher Chedeau committed 2017-04-18 09:47:38 -07:00
1 parent 5e7503dadd
commit 2e613cb37a
1 file changed
+11 -1
+11 -1
View File
@@ -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$`