Testing & Code Quality
Prettier & Formatting
Prettier parses source code and reprints it in a consistent style. Its main value is not that the style is perfect; it is that formatting stops being a human argument.
- Prettier is intentionally opinionated
- Formatter and linter have different jobs
- Format checks belong in CI
- Formatting is not code quality
- Generated files may need exclusions
{
"scripts": {
"format": "prettier --write .",
"format:check": "prettier --check ."
}
}| Tool | Primary job | Avoid |
|---|---|---|
| Prettier | Formatting/layout | Semantic code rules |
| ESLint | Code quality and correctness rules | Competing formatting rules |
| TypeScript | Static type checking | Style enforcement |
| Editor integration | Format on save | Different team behavior per machine |