Commit Graph
161 Commits
Author SHA1 Message Date
Sosuke Suzuki db73cc8e0c Print end-of-line comment for continue/break statements (#12075)
* Add handleBreakAndContinueStatementComments to handleEndOfLineComment

* Add tests

* Add changelog

* Update tests

* Add more tests

* Fix for own line comments

* Fix tests

* Fix tests

* Fix tests

* Add unstable tests
2022-01-19 22:29:37 +09:00
Jed Fox f29a7565e9 Collapse JSXExpressionContainer → AwaitExpression → JSXElement (#12109) 2022-01-16 14:59:22 -05:00
Jed Fox 920283a1dd Inline await expressions in JSX (#12088) 2022-01-15 16:00:39 -05:00
Sosuke Suzuki 6ccc462409 Print comments for parenthesized TS keyword types (#12070)
* Prefer node.start for TS keyword types

* Add tests

* Add changelog

* Refactor

* Use isTsKeywordType

* Fix lint problems
2022-01-13 09:54:06 +09:00
Sosuke Suzuki a50bc4e14a Preserve end-of-line comment for if statement without blocks (#12017)
* Print as dangling comments

* Add tests

* Add changelog

* Use symbol instead of string
2022-01-06 09:31:58 +09:00
Hendrik NijmeijerandHendrik Nijmeijer 846069b6c7 recognize waitForAsync as test-statement in Angular (#11992)
* recognize waitForAsync as test-statement in Angular

* Add changelog_unreleased entry

Co-authored-by: Hendrik Nijmeijer <hendrik@hendriknijmeijer.nl>
2021-12-20 17:04:19 -03:00
sosukesuzuki 59336b9791 Clean changelog_unreleased 2021-12-04 23:35:40 +09:00
fisker Cheung 257a8dfd26 Add changelog for #11892 (#11904) 2021-12-03 13:19:57 +09:00
sosukesuzuki 7fc196e96b Clean changelog_unreleased 2021-11-25 23:12:16 +09:00
04aa850fde Add 2.5 blog (#11823)
* Mark highlights

* Update intro

* Draft

* Update changelog

* Update changelog

* Regenerate draft

* Update TS 4.5 blog URL

* Regenerate draft

* Fix by prettier

* Fix

* Remove changelogs released already

* Address review

* Update

* Regenerate draft

* Regenerate draft

* Regenerate

* Update changelog_unreleased/typescript/11515.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Update changelog_unreleased/typescript/11721.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Update changelog_unreleased/mdx/11563.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Update changelog_unreleased/mdx/11563.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Update website/blog/2021-11-21-2.5.0.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Update website/blog/2021-11-21-2.5.0.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Regenerate

* Address reviews

* Regenerate

* Use examples

* Regenerate

* Address review

* Renegrate

* Address review

* Regenerate

* MDX 2 comments => MDX v2 comment syntax

* Fix

* Update changelog_unreleased/blog-post-intro.md

Co-authored-by: Lucas Azzola <derflatulator@gmail.com>

* Update changelog_unreleased/typescript/11721.md

Co-authored-by: Lucas Azzola <derflatulator@gmail.com>

* Regenerate

* Update changelog_unreleased/typescript/11515.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Regenerate

* Address review

* Regenerate

* Address review

* Regenerate

Co-authored-by: Jed Fox <git@jedfox.com>
Co-authored-by: Lucas Azzola <derflatulator@gmail.com>
2021-11-25 23:04:16 +09:00
fisker Cheung 8a85ba4e18 Update acorn (#11835)
* Update `acorn`

* Fix test, add changelog
2021-11-21 01:44:28 +09:00
Sosuke Suzuki 8f7c2f77a4 Respect spacing for between expressions and parentheses in embedded CSS (#11800)
* Fix embedded css formatting

* Add changelog
2021-11-12 23:17:29 +09:00
Sosuke Suzukiandfisker Cheung aab66b846b Add more tests, update changelog (#11779)
* Update changelog

* Fix

* Add more tests

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-11-08 22:52:20 +09:00
Sosuke Suzuki 6a0995040d Ignore strict errors by @babel/parser (#11778)
* Ignore StrictEvalArguments

* Ignore EvalArgumentsBinding

* Igngore StrictFunction

* Updates tests for binding eval

* Updates tests for eval

* Update changelog

* Address review
2021-11-08 15:14:20 +09:00
fisker Cheung 9440b70563 Fix error on deleting variables (#11750)
* Fix error on delete variables [skip ci]

* Add changelog
2021-11-06 22:06:30 +09:00
Kevin GibbonsandSosuke Suzuki b86d36a28b fix parentheses around sequence expression as body of arrow chain (#11593)
* fix parentheses around sequence expression as body of arrow chain

* add changelog

* lint

* Update changelog_unreleased/javascript/11593.md

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2021-09-28 05:15:17 +09:00
sosukesuzuki d812687502 Clean changelog 2021-09-09 18:29:57 +09:00
Sosuke SuzukiandJed Fox 07476f80a7 2.4 blog post (#11457)
* Mark highlights

* Add new draft

* Update intro

* Fix typo

* Update changelog_unreleased/blog-post-intro.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Update changelog_unreleased/blog-post-intro.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Update changelog_unreleased/blog-post-intro.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Address review

* Address review

* Address review

* Regenerate draft

* Update changelog_unreleased/blog-post-intro.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Update changelog_unreleased/blog-post-intro.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Address review

* Regenerate draft

* Regenerate draft

Co-authored-by: Jed Fox <git@jedfox.com>
2021-09-09 18:24:31 +09:00
Sosuke Suzuki 53f95f3500 Support hack-style pipeline (#11335)
* Avoid to conflicts to v8intrinsic plugin

* Support hack-style pipeline

* Update tests for hask-style pipeline

* Update tests 2

* Add changelog

* Update misc tests

* Address reviews

* Fix type error

* Copy plugin array

* Add tests

* Address review

* Add error tests
2021-08-15 01:16:13 +09:00
Sosuke Suzuki b6fd414918 Count correctly regex literals in method chain arguments (#11299)
* Use getStringWidth instead of String length

* Add changelog

* Fix changelog
2021-08-02 14:15:07 +09:00
Sosuke Suzuki 1ecae48ae8 Support parenthesized tagged template literals for styled components (#11246)
* Support parenthesized styled.property

* Add changelog

* Fix changelog
2021-07-25 18:16:25 +09:00
Sosuke Suzuki e2694e2b21 Clean changelog_unreleased (#11033) 2021-06-09 14:42:00 +09:00
Jed Fox 261bb0314f Fix repositioning the cursor at the end of a range format (#10938)
* Adjust the upper bound on cursorOffset when range formatting

* fix implementation

* Add changelog entry

* Update changelog entry to use PR number
2021-05-24 02:49:49 +09:00
Georgii Dolzhykov 171b1ee2bf Clean changelog_unlreleased 2021-05-10 00:17:59 +03:00
ba1a833378 Add 2.3 blog post (#10659)
* Start 2.3 blog post

* Apply suggestions from code review

Co-authored-by: Alex Rattray <rattray.alex@gmail.com>

* Regenerate the post

* Regenerate blog post

* Regenerate post

* Edit changelog entries

* Regenerate blog post

Co-authored-by: Alex Rattray <rattray.alex@gmail.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-05-10 00:15:27 +03:00
fisker Cheung 877e64c046 Fix missing parentheses on async inside for..of (#10781) 2021-05-06 16:53:48 +03:00
Sosuke Suzuki edc7a30f26 Support async do expressions proposal (#10813)
* Support async-do-expression proposal

* Add more tests

* Add changelog
2021-05-05 22:32:26 +03:00
Georgii Dolzhykov 4d4c0011b6 Edit changelog 2021-04-21 03:34:26 +03:00
Georgii Dolzhykov 08fb7af227 Mark formatting improvements in changelog 2021-04-21 02:45:44 +03:00
Georgii Dolzhykov 33cc92daad Address more feedback in changelog entries 2021-04-21 02:05:22 +03:00
Georgii Dolzhykov 8588462f4b Edit changelog entries (@j-f1's suggestions) 2021-04-20 23:48:06 +03:00
Georgii Dolzhykovandfisker Cheung bc90973cad Avoid arg expansion that leads to broken code (#10712)
* Avoid arg expansion that leads to broken code

* Preserve new lines and only take comments into account if they break lines

* Add robustness against path state corruption due to throwing

* Refactor

* Remove redundant logic

It solved the same issue but only partially.

* Simplify further

* Refactor path.try, fix callParent issue

* Minor refactoring

* Add istanbul ignore comment

* Add return to AstPath#try

Co-authored-by: fisker Cheung <lionkay@gmail.com>

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-04-20 15:02:11 +03:00
Georgii Dolzhykov a610179132 Improve lone argument detection (#10672) 2021-04-15 00:19:23 +03:00
Georgii Dolzhykov ae176f2e79 Process conditional groups in mapDoc (#10695) 2021-04-12 18:15:46 +03:00
Georgii Dolzhykov 22f9256faa Edit changelog entries (JS) 2021-04-12 12:43:47 +03:00
Georgii Dolzhykov 641fe5e3a4 Changelog edits 2021-04-12 05:16:47 +03:00
Sosuke Suzuki 0cdc62e405 Improve formatting for do expression (#10693) 2021-04-12 04:22:44 +03:00
fisker Cheung 07ae0134e5 JS: Fix duplicated prettier-ignore comments (#10666) 2021-04-12 03:35:13 +03:00
Georgii Dolzhykov 1eaa8777a7 Mark changelog entries as highlights 2021-04-08 20:06:06 +03:00
Georgii Dolzhykov 7a5ccc581d Tweak object destructuring in assignments (#10643) 2021-04-06 12:59:14 +03:00
fisker Cheung cc5981227a Add parens for yield in pipeline (#10446) 2021-03-26 10:19:00 +02:00
Sosuke SuzukiandGeorgii Dolzhykov a49942c1ba Support module blocks proposal (#10417)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-24 18:19:11 +02:00
Georgii Dolzhykov 13744dffa2 Fix edge case with trailing comments in arrow chains (#10543)
* Fix edge case with trailing comments in arrow chains

* Remove handling of args.needsSemi from printComments
2021-03-16 15:51:03 +02:00
Georgii Dolzhykov 6a87ce138a Improve detection of AMD define (#10528) 2021-03-15 00:08:37 +02:00
Georgii Dolzhykov 2740ea6ee8 Avoid last-argument hugging for number-only arrays (#10517) 2021-03-14 12:15:53 +02:00
046ffb11f9 Support better formatting for curried arrow functions (#9992)
* Support formatting for curried arrow functions

* Fix test file name

* Fix threshold

* Add changelog

* Fix operator for comparing

* Fix return pos

* Fix eslint

* level 2

* Refactor for level2

* Update tests

* Remove concat

* If it fits on one line, print on one line

* Indent second level arg

* Break before last return value

* Use isCallLikeExpression

* Improve printing

* Add tests

* Remove unnecesary condition

* Fix lint problems

* Update src/language-js/utils.js

Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>

* Update changelog

* Add ImportExpression

* Add ImportExpression to isCallLikeExpression

* Resolve conflicts

* Address reviews

* Fix ESLint problem

* Fix changelog

* Add tests

* More tests

* Print simple arrow chains on one line

* Don't forcibly break chain when a segment has a return type but no params

* Prevent excessive wrapping in assignments

* Simplify

* Format object bodies like blocks

* Update changelog

* Fix last arg expansion

* Simplify

* Fix arrow chains in assignment chains

Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-08 23:18:53 +02:00
Georgii DolzhykovandSosuke Suzuki 5f8fee4d07 Prevent wrapping object properties with short keys (#10335)
* Prevent wrapping object properties with short keys

* Update src/language-js/print/assignment.js

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>

* Use getStringWidth instead of .length

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2021-03-03 01:43:46 +02:00
fisker CheungandGeorgii Dolzhykov 383e17665e Refactor decorators print (#10296)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-01 02:58:43 +08:00
Georgii Dolzhykov 31b3351800 Better formatting for nested await in member/call expression heads (#10342) 2021-02-20 12:50:44 +02:00
Georgii Dolzhykov e147c3b1c4 Fix ASI protection for private fields (#10334) 2021-02-18 12:39:56 +02:00