Skip to content

Instantly share code, notes, and snippets.

@auramo
Created May 17, 2018 17:37
Show Gist options
  • Save auramo/820a8206bbdf8b76a571479986927f1c to your computer and use it in GitHub Desktop.
Save auramo/820a8206bbdf8b76a571479986927f1c to your computer and use it in GitHub Desktop.
Prettier IDEAan

Add prettier to Intellij IDEA

npm install -g prettier
which prettier

-> ^ remember the path

IDEA: settings -> external tools -> add new

Name: prettier Program: Arguments: --write $FilePathRelativeToProjectRoot$ Working directory: $ProjectFileDir$

In Keymap, remove ctrl+S from Save All, and add it to External tools -> prettier (or choose some other shortcut)

Using it in autosave

To trigger on autosave, install File Watchers plugin, then follow these instructions:

https://prettier.io/docs/en/webstorm.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment