What is Prettier?

Prettier is a tool used by developers to check and fix the format of their code. It is an essential tool that you must use to write readable code with consistent formatting.

Prettier transforms ugly code like this:

<html>
<head>
<title>Prettier</title>
</head>
<body>
<h1>Hello from prettier</h1>
</body>
</html>

into readable code like this:

<html>
<head>
<title>Prettier</title>
</head>
<body>
<h1>Hello from prettier</h1>
</body>
</html>

hence the name: Prettier.

How to use Prettier #

Prettier is a very popular tool and its supported by most of the code editor.

Here is the list of supported code editors and the plugin/extension that you can install in order to use Prettier.

Code editor Plugin/Extension
Visual Studio Code Prettier - Code Formatter
VIM vim-prettier, ALE & coc-prettier
Sublime Text JsPrettier
Visual Studio Prettier Extension
Atom prettier-atom
Emacs prettier-emacs
Espresso espresso-prettier

Prettier is used by more than 4 million repositories on github alone, that's very huge number of repositories!

Related tutorials

Show all tutorials ➞

Related projects

Show all projects ➞