Why aren’t you using Prettier?
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
Prettier is a JavaScript code formatter that parses code into an AST and reprints it with consistent styling. It works in three steps: parsing to AST, transforming to an intermediate document tree with opinionated rules, and printing with optimal line breaks. Unlike ESLint, Prettier handles stylistic formatting rather than linting for bugs, and the two tools complement each other. Benefits include eliminating style debates in code reviews, reducing formatting fatigue, lowering the barrier for newcomers, and ensuring codebase consistency. It supports ES2017, TypeScript, JSX, CSS, SCSS, GraphQL, and more. Setup is simple via editor plugins, npm local dependency, or pre-commit hooks.
Sort: