0
Challenge · 82Tooling & Quality

Prettier

Toolused in ~90% of apps

Two engineers, two ways to indent, three opinions about quotes — and every save churns the diff with whitespace nobody chose. Prettier ends the debate: it reprints every file in one canonical style automatically, so code review is about logic, not commas.

Core idea. Prettier is an opinionated code formatter: it parses your code into a tree, throws away how you typed it, and re-prints it in one fixed style. Formatting stops being a decision — it just happens on save.
Playground, this isn't a screenshot
user.js● unsaved
1const user = {name:'Sam', role:"admin"}
2function greet( person ) {
3 return 'hi '+person.name
4}
5const msg = greet(user); const ok = user.role === 'admin' && user.name.length > 0 && true

Mixed quotes, ragged indentation, a missing semicolon, one line way past the print width. It runsfine — but every teammate types it differently, so diffs get noisy.

↑ play a little first, then dig in