prettier/editors/jetbrains
Ilya Panasenko 8a27e121ed fix typo in JetBrains External Tool config readme (#679) 2017-02-12 17:45:49 -08:00
..
README.md fix typo in JetBrains External Tool config readme (#679) 2017-02-12 17:45:49 -08:00
with-prettier.png Add documentation for JetBrains products. (#509) 2017-01-30 10:06:35 -05:00

README.md

Configure External Tool

Go to File | Settings | Tools | External Tools for Windows and Linux or WebStorm | Preferences | Tools | External Tools for OS X and click + to add a new tool. Lets name it Prettify.

In Program set prettier

In Parameters set --write [other opts] $FilePathRelativeToProjectRoot$

In Working directory set $ProjectFileDir$

Example

If on the other hand you have prettier installed locally, replace the Program with ./node_modules/.bin/prettier (on OS X and Linux) or .\node_modules\.bin\prettier.cmd (on Windows).

Configure Keymap

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 about configuring keyboard shortcuts.