Files
test-repo/tests
Misha KaletskyandGeorgii Dolzhykov 911fe7776e method chain breaking heuristic (#6685)
* 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>
2020-01-10 18:00:23 +02:00
..
2020-01-09 16:38:22 +02:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2020-01-10 02:38:28 +02:00
2018-11-25 16:21:14 +08:00
2020-01-08 14:43:19 +02:00
2018-12-29 21:35:47 +08:00
2020-01-09 16:38:22 +02:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2018-12-11 16:18:29 +08:00
2018-11-25 16:21:14 +08:00
2018-12-08 18:28:29 +08:00
2020-01-08 14:43:19 +02:00
2018-11-25 16:21:14 +08:00
2018-12-08 18:28:29 +08:00
2020-01-08 14:43:19 +02:00
2020-01-09 17:01:05 +02:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2020-01-08 14:43:19 +02:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2020-01-08 14:43:19 +02:00
2018-11-25 16:21:14 +08:00
2020-01-08 14:43:19 +02:00
2020-01-09 17:01:05 +02:00
2020-01-09 16:38:22 +02:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00
2018-11-25 16:21:14 +08:00