Commit Graph
16 Commits
Author SHA1 Message Date
b47f7bae43 RFC: Always add a space after the function keyword (#3903)
* 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>
2020-01-20 16:26:47 +02:00
Sosuke Suzuki ac72cd3e94 Merge branch 'master' into next 2020-01-18 06:49:52 +09:00
Kohei Ueno 9c9ff092f5 Fix: remove unnecessary parens when yielding jsx (#7367)
* support YieldExpression inside jsx

* add test cases

* add changelog for pr-7367

* fix changelog file name
2020-01-16 15:54:23 +02:00
fisker Cheung da8d082ce0 Add changelog lint script (#7320)
* Add changelog lint script

* Refactor lint script

* spell

* Fix indent

* fix templateComment

* add H4 check

* Add category in title check

* use array destructuring

* Add space check
2020-01-15 19:25:55 +02:00
Georgii Dolzhykov 7e3c0c73b3 Merge branch 'master' into next 2020-01-14 20:36:21 +02:00
fisker Cheung ac3c046747 Run lint-docs on changelogs (#7253) 2020-01-13 15:13:38 +03:00
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
Sosuke Suzuki d1771e8652 JavaScript: Fix moving semi for return to end of line-comment (#7140)
* Modify to fix semi for return with comment

* Add complex test case

* Add null check

* Add changelog
2019-12-16 20:11:39 +03:00
Brian Kim 64d4b2f49f revert function composition logic for decorators (#7138)
fixes #6953
2019-12-14 19:41:15 +02:00
Georgii Dolzhykov 3c13329f4f fix indentation in ternaries nested in conditions of other ternaries (#7087)
* fix indentation in ternaries nested in conditions of other ternaries

* fix giant indent when tabWidth=4

* refactoring: remove breakNested as it was always true

* break between parens

* add changelog

* microfix

* fix TS conditional types

* Update pr-7087.md
2019-12-04 12:39:29 +03:00
Sosuke Suzuki 2eca6193d7 JavaScript: Format ThrowStatement like ReturnStatement (#7070) 2019-12-01 12:59:15 +01:00
Evilebot Tnawi cad32c0e22 fix formatting of logical and binary expressions in template literals (#7010) 2019-11-22 15:36:34 +03:00
Georgii Dolzhykov bf2989718b fix unstable formatting of logical expressions (#7026) 2019-11-22 00:14:34 +02:00
Evilebot Tnawi 90eed411d4 preserve parentheses for JSDoc type casting with extra spaces a… (#7011) 2019-11-20 18:59:25 +01:00
Clément Dessoude 262f27bc61 Fix handling comments in labeled statements (#6984) 2019-11-18 06:41:44 +01:00
Simon Lydell 4eb3e2650a Blog post, changelog and docs for 1.19 (#6787) 2019-11-09 01:23:57 +01:00