liveBook · Manning

Prettier

Prettier is an opinionated code formatter that automatically rewrites supported source files into a consistent style.

How 2 Manning books explain it

React in Depth

Prettier is an opinionated code formatter that automatically rewrites source code according to configured formatting rules.

How it is used
Automates consistent source formatting to reduce stylistic debate and support team collaboration.
How deep it goes
Works through formatting behavior, configuration, editor integration, and optional commit enforcement without examining formatter internals.
Examples
Uses progressively longer JavaScript filter expressions and a command that selects tabs and removes semicolons.
What you can do after
Operate/configure it in a project through npm, optional rules, editor integration, and optional precommit enforcement.

Read how React in Depth explains Prettier →

Secrets of the JavaScript Ninja, Third Edition

Prettier is an opinionated source-code formatter for JavaScript and related languages.

How it is used
Automates consistent code formatting, reducing manual cleanup and disagreements over style.
How deep it goes
Explains installation, command-line formatting, ignore files, and common options, but not Prettier’s internal formatting algorithm.
Examples
Formats a messy JavaScript module and demonstrates project setup and ignored files.
What you can do after
Apply Prettier to format project files from the command line and exclude selected files.

Read how Secrets of the JavaScript Ninja, Third Edition explains Prettier →

Also covered in

What to know first

Related concepts

Questions about Prettier

What is Prettier?

Prettier is an opinionated code formatter that automatically rewrites supported source files into a consistent style.

Which Manning books explain Prettier?

React in Depth and Secrets of the JavaScript Ninja, Third Edition.

What should I know before learning Prettier?

Manning books that teach Prettier usually introduce JavaScript first.

What is Prettier a kind of?

Prettier is a kind of formatter. A formatter is a software tool that automatically transforms source code into a consistent textual layout according to specified formatting rules.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.