Fixes#4605
The AST here is actually two `html`s and it did follow the [CommonMark spec](https://spec.commonmark.org/0.28/#html-blocks), so I ended up with respecting the blank line between block `html`s.
* Add various tests for ts type annotated function properties.
* Improve format when passing ts arrow function with return type
* Add test for case from #2581.
* Add a single test suite for blank files in all parsers
The parsers that don’t yet support blank files have been filtered out of the list until they do.
* Don’t directly `require()` Prettier
* Update `require`
* Add missing Babylon parser
* Update snapshots
We landed a change that added a new `InterpreterDirective` AST node type for hashbangs, and no longer add it as a comment/leadingComment.
Ref: https://github.com/babel/babel/pull/7928
I mimicked what we do in `@babel/generator` here, since I found it better than trying to add comments to the ast in `parser-include-shebang.js`). Definitely open to a better/cleaner option though!
Note: I'll follow this up with enabling tests for https://github.com/prettier/prettier/pull/4543 and https://github.com/prettier/prettier/pull/4540 once they land too.
* Support new node types for optionals
* Update babylon
* Fix decorator tests
* fix manual errors
* Update flow
* pretty print
* enable option for flow to support ??
* fix AST_COMPARE=1
* fix lint and explicitly test 1_2_3 syntax for flow
* Don't default parser to babylon
* Different default values according to version
* Fix error logging
* Add tests specifically for parser inference
* Add another test case
* Add API test
* Break link definitions onto multiple lines when needed
* Simplify the conditional for breaking the title
* Don’t print the title if it’s blank
* Revert "Don’t print the title if it’s blank"
This reverts commit 2a8d0dd9995a2e5ab8e6d888c07b88dda058637f.
* Add another test
* Fix title printing
* Second time’s the charm
* Third time’s the charm?
* Fix snapshot
* Prettify
* Don’t break unless `proseWrap` is `always`
* Test `proseWrap: never` on link references
* Added support for the graph ql comment tag
As described in the issue https://github.com/prettier/prettier/issues/4360
Prettier still adds a space inbetween the comment tag and the template literal.
* Added comment explaining the random spaces around GraphQL
* Fixed failing AST_COMPARE tests
* Add tests showing existing behavior of various TS casts.
* Improve formatting of TS casts with generics and unions.
By adding a soft break between the cast and the expression. Also
includes wrapping parentheses for clarity as suggested in #4171.
Avoids changing behavior at all though if casting an array or object
literal because those already have good behavior where the array or
object literal breaks before the cast does so including them would just
result in a pointless extra layer of parentheses that would add no
clarity.
* Update tests in prepation for updating long cast format.
* Update so nested breaks inside type cast are indented.
* Add tests where expression being cast is too long itself.
* Update cast formatting to only sometimes break after cast.
Specifically it will break after the cast if that makes the cast itself
fit on a single line. If the cast itself won't fit on a single line then
the expression being cast will be placed directly after the `>` at the
end of the cast.
* Add heuristic to format functional composition more nicely
* Regex -> array
* Use object instead of array for faster lookup
* Remove empty lines
* Add redux connect
Also add comments for libraries