IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Prettier

Last modified: 23 January 2023

Available only in IntelliJ IDEA Ultimate: download to try or compare editions

Required plugins:

JavaScript and TypeScript, Prettier -  The plugins are available only in IntelliJ IDEA Ultimate, where they are enabled by default.

Prettier is a tool to format .js, .ts, .css, .less, .scss, .vue, and .json code. With IntelliJ IDEA, you can format selected code fragments as well as entire files or directories using the Reformat with Prettier action. IntelliJ IDEA adds this action as soon as you install Prettier as a dependency in your project or globally on your computer.

You can configure Prettier to reformat specific files every time such file is changed and the changes are saved automatically or manually.

Also, Prettier can be set as default formatter for specific files. It will run against such files every time you reformat your code with Ctrl+Alt+L.

See Reformat code with Prettier for details.