id: language-support
Prettier attempts to support all JavaScript language features, including non-standardized ones. By default it uses the Babylon parser with all language features enabled, but you can also use the Flow parser with the parser
API or --parser
CLI option.
All of JSX and Flow syntax is supported. In fact, the test suite in tests/flow
is the entire Flow test suite and they all pass.
Prettier also supports TypeScript, CSS, Less, SCSS, Vue, JSON, GraphQL, and Markdown.
The minimum version of TypeScript supported is 2.1.3 as it introduces the ability to have leading |
for type definitions which prettier outputs.