npm install -g prettier
which prettier
-> ^ remember the path
IDEA: settings -> external tools -> add new
Name: prettier
Program:
Arguments: --write
In Keymap, remove ctrl+S from Save All, and add it to External tools -> prettier (or choose some other shortcut)
To trigger on autosave, install File Watchers plugin, then follow these instructions: