What is Prettier?
mainPrettier is an opinionated code formatter that enforces a consistent code style across your entire codebase. It works by parsing your code into an Abstract Syntax Tree (AST) and then reprinting it from scratch based on its own rules and the configured maximum line length. This process removes original styling and ensures code conforms to a consistent format, automatically wrapping lines when they exceed the allowed length.
Supported languages include:
- JavaScript (including experimental features) and JSX
- TypeScript and Flow
- Angular, Vue, and Lightning Web Components (LWC)
- CSS, Less, and SCSS
- HTML
- Ember/Handlebars
- JSON
- GraphQL
- Markdown (including GFM and MDX v1)
- YAML
- MJML