There's a lot of demand for vue sfc (#2097). This introduces partial support for them: all the html is printed as is, except for the script and style tags which are printed using prettier. I believe that this should cover a lot of the use cases while being simple to support and if we want we can extend to more in the future. I copy pasted the html parser used by vue (it's just a single 400 lines file) so that we don't run the chancesof conflicts. I'm also very conservative: I only print the style and script at the top level and for the lang attributes we support. I expect this to be landable as is and provide value, review welcome :)
13 lines
935 B
Markdown
13 lines
935 B
Markdown
---
|
|
id: language-support
|
|
title: Language Support
|
|
---
|
|
|
|
Prettier attempts to support all JavaScript language features, including non-standardized ones. By default it uses the [Babylon](https://github.com/babel/babylon) parser with all language features enabled, but you can also use the [Flow](https://github.com/facebook/flow) parser with the `parser` API or `--parser` CLI [option](options.md).
|
|
|
|
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](https://www.typescriptlang.org/), CSS, [Less](http://lesscss.org/), [SCSS](http://sass-lang.com), [Vue](https://vuejs.org/), [JSON](http://json.org/), [GraphQL](http://graphql.org/), and [Markdown](http://commonmark.org).
|
|
|
|
The minimum version of TypeScript supported is 2.1.3 as it introduces the ability to have leading `|` for type definitions which prettier outputs.
|