This requires you to have the Prettier plugin installed. Works on my IntelliJ IDEA 2020.2.4.
Hit ⌘
-,
to open Preferences.
Navigate to Languages & Frameworks > JavaScript > Prettier.
Set your Prettier package path accordingly.
My repo has a bunch of subdirectories with different Prettier versions alongside my local installation: