Commit Graph
2008 Commits
Author SHA1 Message Date
Georgii Dolzhykov 3d8dc612b5 Bump Prettier dependency to 2.3.0 2021-05-10 00:07:47 +03:00
164a6e2351 Switch CLI to async (#10804)
* Switch CLI to async

* Rewrite test

* Fix tests

* Comment out failed test

* Comment out failed test

* Fix test

Co-authored-by: Connor Peet <connor@peet.io>

* Update patterns-dirs.js

* Fix `hasRunningCli` flag

* Fix grammar

* Update tests/integration/runPrettier.js

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>

Co-authored-by: Connor Peet <connor@peet.io>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-05-09 15:43:10 +03:00
fisker Cheung 877e64c046 Fix missing parentheses on async inside for..of (#10781) 2021-05-06 16:53:48 +03:00
Sosuke Suzuki 711c6d0d27 Support typescript 4.3 via babel (#10811)
* Suppor type members get/set

* Add tests for static index signature in class

* Support override modifier in class

* Add changelog
2021-05-05 22:32:51 +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
Sosuke Suzuki 3a1512f043 Add tests for indexed access via Babel (#10812)
* Add tests for optional indexed access via Babel

* Add tests for indexed access via Babel
2021-05-05 20:49:24 +03:00
dependabot[bot]andsosukesuzuki e29457c952 Build(deps): Bump @babel/parser from 7.14.0 to 7.14.1 (#10819)
* Build(deps): Bump @babel/parser from 7.14.0 to 7.14.1

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.14.0 to 7.14.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.1/packages/babel-parser)

Signed-off-by: dependabot[bot] <support@github.com>

* Update tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2021-05-05 20:48:00 +03:00
George Zahariev 1bcaf61557 Support for Flow's Optional Indexed Access type (#10788) 2021-05-03 22:22:27 +09:00
Sosuke Suzuki 63c744823b Update babel parser (#10802)
* Update

* Use error codes instead of error messages

* Update js tests

* Update ts tests

* Add comments

* Remove plugins enabled by default

* update misc error tests

* Remove moduleStringNmaes

* use allowedMessagesCode directly

* Remove some misc tests

* Update snapshots for integration tests

* Add Redeclaration to cspell.json
2021-05-03 12:12:25 +09:00
Sosuke Suzuki 6b204193c0 Improve formatting for Module Blocks Proposal (#10758)
* Improve

* Add tests

* Fix tests

* Detect specified option object expression
2021-04-27 12:11:53 +09:00
TJ Mazeikaandfisker Cheung 7e4f4d5fe6 Exclude @keyframes params from being parsed as a Less variable (#10773)
* Exclude @keyframes params from being parsed as a Less variable

* Update changelog_unreleased/css/10773.md

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

* Update changelog_unreleased/css/10773.md

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

* Add "keyframes" to cspell.json

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-04-26 01:13:40 +03:00
dependabot[bot]andfisker Cheung 21d4f4e3a9 Build(deps): Bump linguist-languages from 7.13.0 to 7.14.0 (#10755)
* Build(deps): Bump linguist-languages from 7.13.0 to 7.14.0

Bumps [linguist-languages](https://github.com/ikatyang/linguist-languages) from 7.13.0 to 7.14.0.
- [Release notes](https://github.com/ikatyang/linguist-languages/releases)
- [Commits](https://github.com/ikatyang/linguist-languages/compare/v7.13.0...v7.14.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Update snapshot

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-04-26 01:11:35 +03:00
fisker Cheung ece93681f1 Restructure test files (#10415) 2021-04-25 20:01:56 +08:00
dependabot[bot] 5d1ba827c6 Build(deps): Bump @babel/parser from 7.13.15 to 7.13.16 (#10750) 2021-04-25 10:46:41 +00: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 1b2c72df10 TS: don't print parens around nested type assertions (#10702) 2021-04-15 00:19:42 +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
147c30f7fb Build(deps): Bump @babel/parser from 7.13.13 to 7.13.15 (#10682)
* Build(deps): Bump @babel/parser from 7.13.13 to 7.13.15

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.13.13 to 7.13.15.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.15/packages/babel-parser)

Signed-off-by: dependabot[bot] <support@github.com>

* Add test for https://github.com/babel/babel/pull/13099

* Test https://github.com/babel/babel/pull/13049

* Test https://github.com/babel/babel/pull/13101

* Add long name test

* Style

* Print necessary parens in `{ a: (b as any) = 2000 }`

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-04-12 18:15:18 +03:00
Patrick Ahmetovic cbdc8aa376 GraphQL: Fix missing space after keyword in anonymous operations (#10689) 2021-04-12 11:50:39 +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 7a5ccc581d Tweak object destructuring in assignments (#10643) 2021-04-06 12:59:14 +03:00
fisker Cheung 24d39a9068 Throw errors for invalid left-hand side assignment (#10416)
* Throw errors for invalid left-hand side assignment

* Fix tests

* FIx tests

* Add tests from https://github.com/babel/babel/pull/12933
2021-03-30 01:40:42 +03:00
Cyrille David 4407d7b1ea Ember / Handlebars: Do not break opening mustache and path (#10586)
* Add failing tests

* Simplify how mustaches are printed

* Add changelog entry

* Fix changelog

* Make test fail

* Remove a wrong group

* Remove another group

* Record the tests
2021-03-29 15:59:19 +03:00
dependabot[bot] 0ecf5171fe Build(deps): Bump @babel/parser from 7.13.11 to 7.13.13 (#10622) 2021-03-29 12:37:10 +00:00
fisker Cheung cc5981227a Add parens for yield in pipeline (#10446) 2021-03-26 10:19:00 +02:00
George Zahariev 99ac66b73a Support for Flow's Indexed Access type (#10594) 2021-03-25 00:32:53 +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
Sosuke Suzuki f0a612a302 Update @typescript-eslint/typescript-estree (#10589) 2021-03-24 19:39:00 +09:00
fisker Cheung a17d3fb21f Disallow import without argument and new import(…) (#10584) 2021-03-23 09:48:29 +08:00
5a789f52db Build(deps): Bump @babel/parser from 7.13.10 to 7.13.11 (#10546)
* Build(deps): Bump @babel/parser from 7.13.10 to 7.13.11

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.13.10 to 7.13.11.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.11/packages/babel-parser)

Signed-off-by: dependabot[bot] <support@github.com>

* Format type imports in TSImportEqualsDeclaration

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-22 18:15:01 +09:00
dependabot[bot] edce20a822 Build(deps): Bump @glimmer/syntax from 0.77.1 to 0.77.2 (#10550) 2021-03-16 18:03:38 +00: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
dependabot[bot] 72fcf45df3 Build(deps): Bump @babel/parser from 7.13.9 to 7.13.10 (#10523) 2021-03-16 04:07:53 +00:00
Georgii Dolzhykov 6a87ce138a Improve detection of AMD define (#10528) 2021-03-15 00:08:37 +02:00
fisker Cheung 21c81e007d Test json superset (#10493) 2021-03-14 15:04:35 +02:00
Georgii Dolzhykov 2740ea6ee8 Avoid last-argument hugging for number-only arrays (#10517) 2021-03-14 12:15:53 +02:00
Georgii Dolzhykov 169faf39ac Update yaml to 1.10.2 (#10516) 2021-03-14 12:14:08 +02:00
fisker Cheung 3995c2a1a1 Whitelist recovered babel parse errors (#10495) 2021-03-13 22:07:22 +02:00
fisker Cheung 1ce6b8dc3d Fix syntax error on JSON range formatting (#10497) 2021-03-12 00:24:45 +02:00
Georgii Dolzhykov 4ece300581 Fix Flow range formatting (#10505)
* Fix Flow range formatting

* Add changelog
2021-03-10 15:12:27 +02:00
fisker Cheung 02f803ac8d JSON: Only allow +/- number in UnaryExpression (#10434) 2021-03-09 10:58:31 +08: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
Sosuke Suzuki c9144daf47 Support TS 4.2 abstract construct types via ts-estree (#10466) 2021-03-06 19:16:51 +02:00
fisker CheungandGeorgii Dolzhykov 8a1ee9ad1b Support JSON6 (#10456)
* Add test

* Support JSON6

* Test

* Print `null` instead of holes

* More tests

* Update changelog

* Style

* Minor refactor

* Fix AST clean

* Fix `Identifier` clean

* Fix AST compare

* Style

* Reword changelog

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-04 19:37:42 +02:00
Georgii Dolzhykov 37aa31e929 Remove hacks for single-element unions/intersections (#10457)
* Remove hacks for degenerate unions/intersection

* Add changelog
2021-03-04 01:21:03 +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 Cheung 2f384ab24a JSON: More JSON5 data tests (#10453) 2021-03-02 13:43:48 +08:00
fisker Cheung 2edfec5eda JSON: Better error message (#10452) 2021-03-02 13:42:49 +08:00