Commit Graph
80 Commits
Author SHA1 Message Date
Sosuke Suzuki c7a3c16f7d Improve visual separation between header and body in classes with multiline headers (#10085)
* Add hardline for a class whose extends part is broken

refactor

Use groupId

Remove isPreviousLineEmpty

* Avoid leading comments

* Rename to heritage

* Add heuristic for implements

* Fix lint problems

* Fix

Fix

Fix

* Extract getGroupId patterns

* Adopots solution 2

* Fix

* Fix lint problem

* Add changelog

* Address reviews

* Update tests

* Rename to createGroupIdMapper

* Split files

* Add tests for complex extends

* Fix changelog
2021-01-20 15:01:16 +09:00
Georgii Dolzhykov 92cf9452e9 Disable Babel's error recovery for omitted call arguments (#10065) 2021-01-18 09:45:37 +02:00
dependabot[bot]andfisker c5300fa0ca Build(deps): Bump meriyah from 3.1.6 to 4.0.0 (#10060)
* Build(deps): Bump meriyah from 3.1.6 to 4.0.0

Bumps [meriyah](https://github.com/meriyah/meriyah) from 3.1.6 to 4.0.0.
- [Release notes](https://github.com/meriyah/meriyah/releases)
- [Changelog](https://github.com/meriyah/meriyah/blob/master/CHANGELOG.md)
- [Commits](https://github.com/meriyah/meriyah/compare/v3.1.6...v4.0.0)

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

* `FieldDefinition` -> `PropertyDefinition`

* `PrivateName` -> `PrivateIdentifier`

* Test https://github.com/meriyah/meriyah/issues/164

* Copy test from https://github.com/meriyah/meriyah/commit/f21882c312284572ac6d7e7630c4a677d6caed92

* Revert breaking change from 3cdb2a4edc8af0b1c02b1d3f1e1493550164fed0

* Fix test options

* Typo

* Update snapshot

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2021-01-16 01:28:54 +02:00
fisker Cheung be497c3c8f Use printBlock to print ClassBody (#9915) 2020-12-21 17:10:03 +08:00
fisker Cheung cc9460950d Fix inconsistent directive print (#9850) 2020-12-15 12:24:13 +08:00
Sosuke Suzuki aaa9363e6f Print null argument list item (#9787)
* Print null argument list item

* Add changelog

* Add tests for comments
2020-12-08 13:52:30 +09:00
fisker CheungandGeorgii Dolzhykov f59eacd7f6 JS: Fix multiple-comments-on-same-line format (#9672)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-11-30 13:51:49 +08:00
fisker Cheung 05d20a63a4 Exclude node at rangeStart (#9704) 2020-11-30 12:29:48 +08:00
fisker Cheung 664d0d33b5 Fix inconsistent language comment detection (#9743) 2020-11-26 19:30:57 +08:00
dependabot[bot]andfisker 82603f2609 Build(deps): Bump @babel/parser from 7.12.5 to 7.12.7 (#9748)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2020-11-24 14:24:30 +08:00
Sosuke Suzuki 3208b948fc Fix formatting for AssignmentExpression with ClassExpression (#9741)
* Fix formatting for asignment with superClass

* Add tests

* Changelog

* For only AssignmentExpression

* Remove unnecesary ifBreak
2020-11-22 09:24:22 +09:00
fisker Cheung f532bf2b49 Refactor: Module releated format (#9691) 2020-11-19 08:58:56 +08:00
fisker Cheung f9f66711b9 Fix comments in require() with no argument (#9670) 2020-11-16 01:11:53 +08:00
Georgii Dolzhykov e721ef30ea Flatten function expression parameters in hugged last argument (#9662)
Fixes #3376
This was done for arrow functions in #1305 ("Avoid breaking arguments for last arg expansion").
This PR enables the same for function expressions unless the function expression is the only argument.
2020-11-14 13:17:01 +02:00
Brian Kim d0f813e5d4 Revert #9011, don’t add parens when yielding simple JSX expressions (#9650) 2020-11-13 08:49:15 +08:00
c91914e610 Build(deps): Bump @babel/parser from 7.12.3 to 7.12.5 (#9597)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
Co-authored-by: fisker <lionkay@gmail.com>
2020-11-06 19:30:42 +08:00
fisker Cheung 7836466d67 Test: snapshot parse errors (#9467) 2020-11-06 15:27:04 +08:00
fisker Cheung 7075c9cff4 Exclude inline comments from flow annotation comments (#9572) 2020-11-05 23:12:23 +08:00
fisker Cheung 3d7016e2dc Add meriyah parser (#9514) 2020-11-05 14:08:37 +08:00
fisker Cheung 98e85eec74 Test "import assertions" on other parsers (#9475) 2020-10-23 20:44:29 +08:00
fisker Cheung 6fbf38b55b Add parens to object value that it's an assignment (#9484) 2020-10-23 20:43:42 +08:00
Sosuke Suzuki 13f3336bba Support class-static-block proposal (#9476)
* Support class-static-block proposal

* Update changelog
2020-10-23 20:09:07 +09:00
Sosuke Suzuki 3b7a7ba3c9 Update @babel/parser to 7.12 (#9408)
* Install babel/parser 7.12

* Add tests for babel/babel#12161

* Add test for babel/babel#12076

* Add test for babel/babel#12085

* Add test for babel/babel#12108

* Add test for babel/babel#12120

* Add test for babel/babel#12054

* Add test for babel/babel#12061

* Add test babel/babel#12093

* Add test for babel/babel#12065

* Add test for babel/babel#12111

* Add test for babel/babel#12072

* Switch syntax-module-attributes to syntax-import-assertion

* Support "String import/export specifier"

* Remove tests for module-attributes

* Add changelog

* Update to 7.12.3

* Fix by linter

* Fix by spellchecker

* Add tests for module attributes to errors

* Add error test for module string name with import

* Remove TSTypeCastExpression

* Add tests for funny import-assertions

* Update snapshots|

* Add more tests
2020-10-20 19:01:30 +09:00
fisker Cheung 140cb14f3a JS: Fix import {a as a} and export {a as a} format (#9435) 2020-10-20 14:38:34 +08:00
fisker Cheung 7d80bae76a Consistent format on invalid template literals (#9431) 2020-10-17 00:51:00 +08:00
fisker CheungandChris Brody 73e3976c34 Add espree parser (#9000)
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
2020-10-13 09:14:02 +08:00
Sosuke Suzuki bba196abc8 Improve formatting for AssignmentExpression with ClassExpression that has long superClass (#9341)
* Improve formatting for AssignmentExpression with ClassExpression that has long superClass

Fix by prettier

* Add changelog

* Remove unnecesary concat call

* Mention abount Google Closure Library in changelog
2020-10-08 20:11:15 +09:00
Sosuke Suzuki bb238f5765 Fix placing leading comments for a body of while statement (#9345)
* Add leading comments for while

* Add tests

* Add changelog
2020-10-08 17:08:40 +09:00
fisker CheungandGeorgii Dolzhykov 64cb7abed8 JS: Fix comments inside template (#9278)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-10-05 05:49:52 +08:00
fisker Cheung 203be9da5a Change test package name (#8848) 2020-09-18 14:05:29 +08:00
fisker Cheung 94ef5f5683 Test: Fix indexes calculation (#9152)
* Test: Fix indexes calculation

* Simplify logic

* Update snapshots
2020-09-17 07:31:29 +08:00
fisker Cheung 4de63cfc4f Test: add test for issue 5961 (#9153) 2020-09-07 17:59:50 +03:00
fisker Cheung 370844cc4c Run full test on every parser (#9070)
* Refactor test

* Fix

* Improve `hasPragma` & `insertPragma` on files has BOM

* Fix `coreFormat` cursorOffset

* Code style

* Update snapshots

* Refactor

* Restore BOM test

* Add export

* Empty file

* return after SyntaxError

* EOL test

* Fix eol tests

* Named export

* Tweak matrix

* Disable on `requirePragma`

* Disable `cr` test

* Simplify logic

* Update `verbose`

* Remove `test:full-test`

* Typo
2020-09-04 23:43:41 +08:00
dependabot[bot]andfisker 6c05c75e06 Build(deps): Bump flow-parser from 0.132.0 to 0.133.0 (#9135)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2020-09-04 16:00:08 +08:00
Sosuke Suzuki 2c0e9838f2 Fix line breaks for CSS in JS (#9136)
* Fix 2.1 regression for css-in-js

* Add changelog
2020-09-04 13:12:58 +09:00
dependabot[bot]andfisker 0983660aa8 Build(deps): Bump @babel/parser from 7.11.2 to 7.11.5 (#8947)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2020-09-01 19:26:19 +08:00
Sosuke Suzuki cc63358c90 Respect spacing between template values in embedded css (#9078)
* Respect no space for embedded css

* Fix by lint

* Add changelog
2020-08-28 11:08:29 +09:00
Sosuke Suzuki c4e9dd9c36 Continuation of revert 7889 (#9024)
* Continuation of revert 7889

* Remove isLiteralLikeValue

* Revert callHasComplexArguments

* Revert usage of shouldMerge
2020-08-23 01:23:41 +09:00
fisker Cheung 08e8b40ac6 Move non-js syntax test out of tests/js/ dir (#9023) 2020-08-22 14:50:54 +08:00
fisker Cheung 95ba0aeb79 Update javascript tests to avoid syntax errors (#9019) 2020-08-22 01:00:14 +08:00
Sosuke SuzukiandChristopher J. Brody 751f67af1f Upgrade to TypeScript 4.0 (#8982)
* Upgrade to TypeScript 4.0

* Update tests

* Fix changelog

* Revert invalid label tests

* Set loggerFn to false

* Use TS 4.0

* Apply logical assginment test for TypeScript

* Remove hack for NamedTupleMember

* workaround for TypeScript 4.0 in src/language-js/utils.js

Co-authored-by: Christopher J. Brody <chris.brody+brodybits@gmail.com>
2020-08-21 16:09:28 +09:00
fisker Cheung 1d2ff824cc Improve requirePragma on files with BOM (#9003) 2020-08-21 10:30:42 +08:00
fisker Cheung d31ebf4619 Test: Improve coverage (#8811) 2020-08-21 09:43:24 +08:00
fisker Cheung dc46155962 Revert #7367 "Fix: remove unnecessary parens when yielding jsx" (#9011) 2020-08-21 09:09:45 +08:00
fisker Cheung 2ff156136f Improve internal cursorOffset calculate (#9013) 2020-08-21 09:09:15 +08:00
Sosuke Suzuki e3f075b3e7 Revert #7889 (#8861)
* Revert #7889

* Remove changelog

* Run prettier
2020-08-20 00:00:27 +09:00
fisker Cheung 6833310f87 Fix wrong range format on files with BOM (#8936) 2020-08-10 22:18:55 +08:00
fisker Cheung 0a2ec1b4a2 Fix range tests with TEST_CRLF and endOfLine option (#8821) 2020-08-08 16:45:44 +08:00
dependabot[bot]andfisker 74b5f65565 Build(deps): Bump @babel/parser from 7.11.1 to 7.11.2 (#8922)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2020-08-06 20:19:11 +08:00
dependabot[bot]andfisker e2e0ddf08c Build(deps): Bump @babel/parser from 7.11.0 to 7.11.1 (#8914)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2020-08-06 10:40:49 +08:00