Express/NodeJs

Improve your NodeJS code style with Prettier

February 4th, 2022

In this article:

Code style is one of those things that seem small but can generate huge arguments. More than any particular code style, what's important is consistency. Nobody wants to work on a project where each contributor follows a different style!

Prettier solves this by picking a single standard and then making it easy to automatically format all your JavaScript code to conform to it. You can run it in your pre-commit hooks, or even better, integrate with your code editor or IDE to format as you code.

Prettier

That's why we've added Prettier support directly to API Bakery. Out of the box, your projects can now be configured to use prettier (manually), and the generated code is already conforming to Prettier standard code style.