Skip to content

Commit

Permalink
Add jestbrains filewatcher docs (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored and vjeux committed Apr 18, 2017
1 parent 5e7503d commit 2e613cb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion editors/jetbrains/README.md
Expand Up @@ -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

Expand All @@ -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$`

0 comments on commit 2e613cb

Please sign in to comment.