* Heuristic for grouping parameters in method signatures
* Apply the same logic to function declaration and Flow types
* Group only if there is only one parameter
* Don't group if type param has constraints/default or >1 type param
* Quote and unquote number keys
* Add changelog entry
* Add tests for escapes
* Fix idempotency
* Only run flow-repo/ tests with flow
271 jsfmt.spec.js in flow-repo use only the flow parser.
18 use flow and babel.
Now, all of them use only flow.
* Don’t unquote negative numbers
* Don’t quote/unquote numbers in TypeScript
* Quote BigInt
* Fix AST check
* Fix condition
* Fix BigInt to string
* Fix ESLint not recognizing BigInt
* Only quote/unquote “simple” numbers
* No need to clean BigIntLiteral anymore
* Add tests for 1. and .1
* Fix 1. and .1
* Remove unnecessary babel-ts from tests
* Only unquote numbers for babel
* Update changelog
* Run `format()` in test function
* Wrap `test`s in `describe`
* Update tests_config/run_spec.js
Co-Authored-By: Georgii Dolzhykov <thorn.mailbox@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
* Put space after generator star, not before
* remove pr-7516.md, edit pr-3903.md instead
Because the release blog post will be generated from these files.
* edit pr-3903.md
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
* Always add a space after the `function` keyword
* WIP update snapshots
* WIP put generator function asterisk before space
https://github.com/prettier/prettier/issues/3847#issuecomment-363449250
* WIP update snapshots
* Add changelog
* Add tests for anonymouse generator function
* print space between `function` and generator star
* update changelog
* print space between yield and *
Co-authored-by: Joseph Frazier <1212jtraceur@gmail.com>
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
* examples from various issues about method chaining
this commit includes no prettier functionality changes, so that diffs will be easily visible.
specifically:
* https://github.com/prettier/prettier/issues/4125
* https://github.com/prettier/prettier/pull/4765
* https://github.com/prettier/prettier/issues/1565
* https://github.com/prettier/prettier/issues/3107
* add heuristic for breaking method chains
* fix: remove unnecessary escape characters
* initial non-regex isSimple implementation
* handle babel literal types properly
found here: https://github.com/babel/babel/blob/fe258dec047f473fb5a35172b2ff8cb172051dec/packages/babel-parser/ast/spec.md
* template literal + test
* use !every instead of some(!)
* fix: some test cases
* fix: object expressions and some more simple node types
* some test cases showing need for depth check
* depth check
* update test to test thing it's supposed to test
* optional expressions
* test case for missing isSimple depth
* fix isSimple depth bug
* fix: comment check
* test for ts non-null operator
* make object properties behave similarly to arrays
* isSimple -> isSimpleCallArgument; move to utils; add unaries
* add Import to the list of simple things
* only short regexps to be considered simple (<= 5 chars)
* add changelog entry in the new format
* update snapshots
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
* Modify to define isJestEachFunctionCall
* Modify to break ArrayExpression when parent is jest each function
* Add tests
* Update CHANGELOG.unreleased.md
* Fix comment
* Add pr number
* Update CHANGELOG.unreleased.md
* Remove hasNewLineInRange
* Modify to change logic for breaking jest each call function
* Modify to add logic for breaking ArrayExpression
* Modify to avoid mixed nested array
* Modify to remove changes for jest
* Update CHANGELOG.unreleased.md
* Update CHANGELOG.unreleased.md
* chore: upgrade Jest
* chore: update snapshots
* chore: lock down babel dependency using invalid syntax
* 2 args to test.skip
* use jest 22 for now
* Revert "2 args to test.skip"
This reverts commit 691fdc3f99e320f2303958f2b503f7b4c93fa455.
* remove snapshot name from matcher
* fix standalone tests skips
* Upgrade flow to 0.64
This also enables spread operator on jsx on the flow parser:
```js
<div>{...list}</div>
```
I had no idea it was even a thing.
I had to comment out a flow test that no longer parses, but it's no longer in the flow repo and the comment said that it shouldn't be working anyway so I don't think it's going to be a problem.
* Fix build script
* Added prettier layout for class extends and implements
* Added prettier layout for class extends and implements, fix with keeping it in online if it fits
* Added prettier layout for class extends and implements, fixed tests as a side change
* Extends implements comments in same line fix
* Extends implements comments in same line without ugly workaround
* added empty line to test typescript_class/extends_implements.ts
* If only one extends keep old behaviour
* Removed console logs