JavaScriptJavaScript

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:

<TaskOptions>
  <TaskOptions>
    <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>
    <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 />
  </TaskOptions>
</TaskOptions>

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

Hey, if you've found this useful, please share the post to help other folks find it:

There's even more:

Subscribe for updates

  • via Twitter: @timonweb
  • old school RSS:
  • or evergreen email ↓ ↓ ↓