🛠️Prettier
Also known as Prettier Formatter, prettier --write
A free tool that tidies the layout of code. It works on JavaScript, CSS, HTML and more.
Think of it like
It is like a helper who folds all the clothes the same way. Every pile looks neat.
Example
Lucy and Jack used to fight over quotes in code reviews. Now Prettier runs on save, and every file looks the same.
Why it matters
Reviews can focus on what the code does, not where the spaces go. Every file reads the same.
Definition
Example code
console
$ npx prettier . --writeCommon mistake
Key takeaways
- 1One style. It prints all code the same way.
- 2Few settings. Less to argue about, on purpose.
- 3Run on save. Then nobody has to think about it.