* src/util: Fix negative number handling
* src/util: Handle decimal numbers with leading plus sign
* src/util: Handle sign symbols before numbers in scientific notation
We used to be very naive and just push all the comments at the top of the class, but it's very brute force (and breaks some flow annotations inside of fb) so we can do better :)
parser-postcss parses `@import` at-rules specially, and unfortunately
buggily. This monkey-patches parser-postcss to parse all at-rules the
same way.
Fixes#2584.
postcss-less bug: https://github.com/shellscape/postcss-less/issues/88
* Use printPropertyKey function to print keys in object type property in TS and Flow
* Remove flow test modification
* Add tests for new object key cases
* Add new test file
* Fix some styles
* Handle closure compiler type cast syntax correctly
Fixes https://github.com/prettier/prettier/issues/1445
* Move closure type cast detection to needParens in fast-path.js
* every => some and added additional check for leading comment
* Add comments showing parser arguments
Since this is how they are invoked, the comments make it easier to maintain.
* Use babylon.parseExpression for JSON
See https://github.com/prettier/prettier/issues/2378#issuecomment-314600778
Note that this doesn't yet print comments:
echo '{/*comment*/"K":"V"}' | ./bin/prettier.js --parser json
* Remove parser-json.js
This reduces duplicate code in the built package.
See https://github.com/prettier/prettier/pull/2476#pullrequestreview-50181398
* Add test with block comment in JSON
* Fix test with block comment in JSON
* Add test with line comment in JSON
* Don't build now-redundant parser-json.js
* Now JSX-mode ternaries only break if they need to.
* Only the outermost ternary in a chain of JSX-mode ternaries will become a group.
* We don't wrap null in parens when breaking JSX-mode ternaries.
This commit also improves the test coverage and explanation in tests/jsx/conditional-expression.js.
* Arrow Function Expressions returning JSX will now add parens when the JSX breaks
* Conditional expressions within (or containing) JSX are formatted in a more natural way (for JSX), especiall when chained
* JSX in logical expressions (|| or &&) is always wrapped in parens
Fixes#2208