Commit Graph
78 Commits
Author SHA1 Message Date
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
Georgii Dolzhykov fa04a5b464 Cleanup changelog_unreleased (#9325)
These were released in 2.1.2
2020-10-06 10:12:46 +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
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
Georgii Dolzhykov 488e08d70b Remove the need to add full GitHub links in changelog entry titles (#9104) 2020-09-01 08:51:32 +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
18b4cabc0c Add 2.1 blog post (#8932)
* Add draft for 2.1 blog post

* Update cspell.json

* Update website/blog/2020-08-04-2.1.0.md

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

* Update website/blog/2020-08-04-2.1.0.md

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

* Update website/blog/2020-08-04-2.1.0.md

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

* Update website/blog/2020-08-04-2.1.0.md

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

* Update website/blog/2020-08-04-2.1.0.md

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

* Update changelogs

* Add author to cspell ignore patterns

* Update cspell.json

* Fix original changelog

* Run draft script

* Update

* Fix TypeScript on Highlights

* Fix heading

* Fix author

* Fix changelog for 8410

* Fix syntax highlight

* Move changelog for 7844 to /scss

* Update website/blog/2020-08-21-2.1.0.md

Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>

* Remove changelog_unreleased

* Update filename

* Replace to actual version manually

Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
2020-08-24 20:36:52 +09:00
fisker Cheung dc46155962 Revert #7367 "Fix: remove unnecessary parens when yielding jsx" (#9011) 2020-08-21 09:09:45 +08:00
Sosuke Suzuki e3f075b3e7 Revert #7889 (#8861)
* Revert #7889

* Remove changelog

* Run prettier
2020-08-20 00:00:27 +09:00
fisker Cheung 797e93fc0a Support Decimal Proposal (#8901) 2020-08-05 11:04:30 +08:00
fisker Cheung d725261fc5 MDX: fix unstable format when embedded off (#8825) 2020-07-25 02:06:22 +08:00
fisker CheungandGeorgii Dolzhykov 07e5b06a1f Fix unstable pair of comments between class methods (#8731)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-07-15 12:16:49 +08:00
fisker Cheung 639e7fc869 Fix duplicated comments (#8742)
* Add failed test

* Fix issue

* more tests

* Restore verify parser

* Add changelog

* Update snapshots
2020-07-14 15:06:57 +03:00
Sosuke Suzuki 02137069a7 JavaScript: Break ternary expressions containing a multi-line block comment (#8592)
* Break ternary expression when there is multiline block comment

* Add changelog
2020-06-21 17:02:58 +09:00
Simon Lydell 9184743081 Quote and unquote number keys (#8508)
* Quote and unquote number keys

* Add changelog entry

* Add tests for escapes

* Fix idempotency

* Only run flow-repo/ tests with flow

271 jsfmt.spec.js in flow-repo use only the flow parser.
18 use flow and babel.
Now, all of them use only flow.

* Don’t unquote negative numbers

* Don’t quote/unquote numbers in TypeScript

* Quote BigInt

* Fix AST check

* Fix condition

* Fix BigInt to string

* Fix ESLint not recognizing BigInt

* Only quote/unquote “simple” numbers

* No need to clean BigIntLiteral anymore

* Add tests for 1. and .1

* Fix 1. and .1

* Remove unnecessary babel-ts from tests

* Only unquote numbers for babel

* Update changelog
2020-06-18 18:13:25 +03:00
Sosuke Suzuki 29959103a9 TypeScript: Prefer leading comment when there is a comment on after "?" in conditional types (#8557)
* Fix #8555

* Add changelog
2020-06-15 20:08:43 +09:00
Mellina Yonashiro ad855e4e03 Fix: don't wrap arrays in test.each template strings (#8354) 2020-06-15 00:09:23 +03:00
Georgii Dolzhykov 3094ad5aa2 Fix unstable comments in binary expressions (#8491) 2020-06-05 09:55:22 +03:00
Georgii Dolzhykov 1df6838b0e Revert #7787 (#8495) 2020-06-04 14:38:51 +03:00
Sosuke SuzukiandGeorgii Dolzhykov 9c67e7b7f1 JavaScript: Fix indentation for binary expressions with trailing comments (#8476)
* Modify to align binaryish expression with trailing comment

* Add tests

* Add comment

* Add test

* Add changelog

* Fix by lint

* Modify to move transformation to printBinaryishExpressions

* Remove unnecessary new line

* Fix hasTrailingCommentInBinaryish

* Add shouldReturnParts option to printComments

* Add tests from review

* Fix by lint

* Extract and use normalizeParts

* Group CallExpression when parent node is binaryish

* Fix by lint

* Remove unnecessary change

* Wrap the doc of most left node with group

* Add tests

* Update pr-8476.md

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-06-04 08:59:05 +03:00
Sosuke Suzuki 85f0b0cc79 Fix Stage-1 => Stage-2 (#8487) 2020-06-03 19:22:11 +09:00
fisker Cheung 2b68f981fd Babel: support record and tuple syntax (#8453) 2020-06-03 09:35:13 +08:00
fisker Cheung 7d2e57c67f Babel: support moduleAttributes (#8436) 2020-06-02 20:31:33 +08:00
Sosuke Suzuki 6b4c4066aa JSX: Wrap jsx element on the left of "<" with parentheses (#8461)
* Modify to wrap jsx on the left of "<"

* Only left

* Add changelog
2020-06-01 10:27:55 +09:00
Georgii Dolzhykov 5a0e33cc84 fix(range): improve detection of JS source elements (#8419)
* fix(range): improve detection of JS source elements

* Add changelog entry

* Remove unneeded comment

* Add more types and update snapshots
2020-05-29 07:29:09 +03:00
Sosuke Suzuki f31430d7be JavaScript: Support Babel 7.10 private field in in (#8431)
* Support Babel 7.10 private in

* Add changelog

* Fix changelog
2020-05-28 03:02:10 +09:00
Georgii Dolzhykov 81d7e06973 Fix range indentation (#8410) 2020-05-27 11:48:32 +03:00
Georgii Dolzhykov d420202df4 fix(js): comments after superclass (#8312)
* Fix comments after superclass

* add changelog

* refactor

* Organize tests

* Use addBlockStatementFirstComment

* Amend unstableTests list

* Avoid identical comments in tests

* Add tests for `implements`

* Handle comments in interfaces

* Remove an always-false condition

* Almost a fix

* Further fixes

* Add DeclareClass

* Add DeclareInterface, mixins

* Fix extends in DeclareClass

* Fix DeclareClass

* Fix mixins

* Refactor: remove unused parameters

* Add marked dangling comments

* Unify printing of interface for TS and Flow

* Fix unstable interfaces

* Remove comment

* Restore the original behavior for interfaces with multiple inheritance

* Refactoring, tests

* Remove unused code

* Include a file accidentally omitted from the merge commit

* Remove unused type import
2020-05-24 21:53:29 +03:00
fisker Cheung f2c1d70918 JS: pragma support files with shebang (#8376) 2020-05-23 19:28:05 +08:00
Georgii Dolzhykov ce2114533a Fix extra space after minus in CSS-in-JS (#8255)
* Fix extra space after minus in CSS-in-JS

* add changelog entry
2020-05-08 16:53:36 +03:00
Abdullah AttaandGeorgii Dolzhykov 8acc9e2a48 fix inconsistent parsing of injected expressions in styled-components' css (#8097)
* fix inconsistent parsing of styled-components' css

* fix for multiple placeholders in one line

* add test for multiple placeholders in one line

* add changelog for the pr

* fix multi part placeholders

* make placeholderMatch regex stricter

* add tests for all fixed cases

* update changelog

* fix changelog link

* do not edit the original doc.parts

* fix changelog output

* simplify logic

* remove unnecessary `tokens` array

* simplify logic even more

* changes according to review

* finalize

* update snapshots after merge

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-05-07 16:06:13 +03:00
Masashi HiranoandGeorgii Dolzhykov 3b78c021d1 JS: Keep the position of end-of-line comments in binary expressions (#7787)
* JS: block comments with LogicalExpression

* Add changelog_unreleased for #7787

* Add handleBinaryExpression in comments.js

* Refactor comments.js to use isBlockComment

* Update pr-7787.md

* Update pr-7787.md

* test: regenerate snapshot for comments/logical-expression

* test: logical-expression.js as unstable tests

* test: add comments/binary-expressions-trailing-space.js

* fix: make two functions one 'handleEndOfLineBlockComments'

* Rename handleEndOfLineBlockComments to handleBinaryExpression

* Refactor handleBinaryExpression to remove unneed condition & params

* Divide and rename test files for handleBinaryExpression()

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-05-07 16:05:27 +03:00
fisker Cheung 82676f6308 Keep object key with escape sequence as it is (#8160) 2020-04-27 10:30:00 +08:00
fisker Cheung e69e90f067 Fix object trailing commas that last property is ignored (#8111)
* Add failed tests

* Fix trailing commas when last property is ignored

* Add changelog

* Add nested tests

* changelog title
2020-04-25 17:54:10 +03:00
Masashi Hiranoandfisker Cheung 1528e45ff2 JS: Fix end-of-line comments if followed by trailing whitespace (#8069)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2020-04-25 10:38:06 +08:00
Georgii Dolzhykov f67f65055b Further improve method chain breaking heuristic (#7889) 2020-04-16 00:07:44 +03:00
Kevin Gibbons 22d149b9f6 Add --embedded-language-formatting={auto,off} option (#7875) 2020-04-11 20:22:44 +03:00
Sosuke SuzukiandGeorgii Dolzhykov 17d6e38d34 JavaScript: Fix pipeline bugs (#7979)
* Fix arrow regression

* Fix resolvePluginConflict

* Update changelog

* Fix condition

* Edit changelog: add link to Babel blog, change order (to be as in the blog)

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-04-08 23:49:46 +09:00
Sosuke SuzukiandGeorgii Dolzhykov ccaaad007d JavaScript: Support Smart and F#-style Pipeline (#6319)
* Modify to support smart-pipeline in printer

* Add tests

* add a changelog entry

* change minimal to smart

* fix parens issues

* Support fsharp-pipeline

* Fix needs-parens

* Try to fix ci problem

* Update changelog

* Add more tests

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-04-07 19:42:45 +09:00
Georgii Dolzhykov ea5f3b043f Release 2.0.3 2020-04-05 23:47:18 +03:00
Sidharth Vinod 04e4ef3758 Uniform line endings for multi line strings/comments (#7891) 2020-04-05 13:51:29 +03:00
Georgii Dolzhykov 2d1142fc30 Use scss parser for css-in-js (#7883) 2020-03-31 17:10:38 +03:00
Kevin Gibbons 18bf01e8f8 Fix bug with holes in array literals (#7911) 2020-03-31 12:43:19 +03:00
fisker Cheung b0ffc0f1df Fix prettier-ignore inside JSX (#7877) 2020-03-26 20:10:05 +02:00