Prettier File Watcher for PyCharm (or any other IDEA-based editor)

Mar 26, 2018 · by Tim Kamanin

Save the following code as an xml and import it as a file watcher into Pycharm:

    <option name="arguments" value="--write $FilePathRelativeToProjectRoot$" />
    <option name="checkSyntaxErrors" value="true" />
    <option name="description" />
    <option name="exitCodeBehavior" value="ERROR" />
    <option name="fileExtension" value="js" />
    <option name="immediateSync" value="false" />
    <option name="name" value="Prettier" />
    <option name="output" value="$FilePathRelativeToProjectRoot$" />
    <option name="outputFilters">
      <array />
    <option name="outputFromStdout" value="false" />
    <option name="program" value="prettier" />
    <option name="runOnExternalChanges" value="true" />
    <option name="scopeName" value="Project Files" />
    <option name="trackOnlyRoot" value="false" />
    <option name="workingDir" value="$ProjectFileDir$" />
    <envs />

You should now have Prettier formatting your javascript automatically. No more ugly JS!

Want to get more 🔥 tips like this one?

Subscribe to get notified about new dev tutorials