Commit Graph
254 Commits
Author SHA1 Message Date
fisker Cheung 47ca2c1552 Keep empty import attributes and assertions (#15757) 2023-12-05 17:55:18 +08:00
fisker Cheung 7015f10d8e Keep curly braces and from keyword in empty import statements (#15756) 2023-12-05 16:13:31 +08:00
Sosuke Suzuki a3e1be82b6 Clean changelog 2023-11-13 12:04:23 +09:00
SUZUKI Sosukeandfisker Cheung 62d0c22638 Add 3.1 blog post (#15503)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-11-13 12:01:29 +09:00
SUZUKI Sosuke 1d45bce625 Consistently format strings containing escapes (#15525) 2023-10-29 21:52:38 +09:00
SUZUKI Sosuke f852b8010e Improve formatting for assignment its left can break (#15547) 2023-10-28 14:29:17 +09:00
4aa5fd1c79 New Ternary Formatting: A Curious Case of the Ternaries (#13183)
Co-authored-by: Alex Rattray <rattrayalex@stripe.com>
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2023-10-09 10:44:30 +09:00
SUZUKI Sosuke 14ddf452c4 Update @babel/parser to 7.23.0 (#15485) 2023-10-08 22:26:13 +08:00
Lucas Santos f4491b1274 Fix name case of selectors in styled components interpolation (#15472) 2023-09-30 15:57:53 +09:00
Luca Casonatoandfisker Cheung b78d7c7d2d Disambiguate unary expr in instanceof and in (#15468)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-09-28 14:56:55 +08:00
Alex RattrayandAlex Rattray f25a592f57 Add indentation back to nested ternaries (#9559)
* Add indentation back to nested ternaries (except JSX)

* Add a real-world test case

* Add changelog entry

---------

Co-authored-by: Alex Rattray <rattrayalex@stripe.com>
2023-09-24 15:13:00 -04:00
fisker Cheung 411ef345a2 Fix comment between parentheses and function body (#15326) 2023-09-02 09:18:15 +08:00
Sosuke Suzuki 28578bf0a3 Clean changelog 2023-08-29 21:32:11 +09:00
fisker Cheung f75f717c4e Allow break require() argument (#15256) 2023-08-23 15:58:06 +09:00
Sosuke Suzuki b35d6f6612 Remove changelog 2023-08-16 00:47:18 +09:00
Seiya bf0b3040be Break after equal on assignment if rhs is await/yield expression (#15204)
* add as-is test

* break after equal on assignment if rhs is wait

Discussion: #15196

* rename test file

* add as-is test

* treat YieldExpression

* add tests

* add changelog

* fix a bug

* add test for delegated yield
2023-08-06 13:02:40 +09:00
Sosuke Suzuki 75ac271661 Clean changelog 2023-08-03 15:12:46 +09:00
fisker Cheung 29854ca8da Fix comments print in IfStatement (#15076) 2023-07-29 10:01:46 +08:00
auvred 8da37cce0b Add parenthesis around leading multiline comment in return statement (#15037) 2023-07-16 14:15:08 +09:00
fisker Cheung e2f4ce38f7 Improve cursor tracking (#14812) 2023-07-06 09:51:29 +08:00
Sosuke Suzuki 266344398c Clean changelog 2023-07-06 01:47:41 +09:00
Pieter VanderwerffandSUZUKI Sosuke ff7b025197 Support trailing comments in function parameters for all parameter node types (#14835)
* Support trailing comments in function parameters for all parameter node types

* Create 14835.md

---------

Co-authored-by: SUZUKI Sosuke <aosukeke@gmail.com>
2023-07-03 02:47:13 +09:00
SUZUKI SosukeandNicolò Ribaudo 7ad852636d Support Import Attributes (#14863)
* Print import attributes

* Update visitor keys for import attributes

* Update snapshots for visitor-keys

* Update `babel-plugins` tests

* Update import attributes tests

* Update misc tests

* Add changelog

* Enable `importAttributes` and `importAssertions`

* Print ImportAssertion syntax

* Add `babel-plugins` tests

* Add import assertions tests

* Add misc tests for import assertions

* Update changelog

* Fix words

* Use `deprecatedAssertSyntax`

* Update `@babel/parser`

* Use deprecatedAssertSyntax

* Remove needless tests

* Update `@babel/types`

* Update visitor-keys

* Run `yarn dedupe`

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

Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>

* Address review

---------

Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>
2023-05-31 00:47:12 +09:00
SUZUKI Sosuke 4d7afff735 Tests for await using syntax (#14862)
* Add tests for `await using`

* Add tests for `await using` from Babel

* Add changelog

* Fix changelog
2023-05-29 20:50:18 +09:00
8108864d7f Fix empty line check between array elements (#14736)
Co-authored-by: ☀️ <sol@solfox.online>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-05-05 15:17:11 +08:00
Seiyaandfisker Cheung 7f64e920de Make curried arrow function and normal arrow function consistent (#14633)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-04-27 11:01:35 +08:00
fisker Cheung bec997e85c Fix cursor tracking inside JSXText (#14163) 2023-04-10 10:44:31 +08:00
fisker Cheung 20320a56e4 Fix typo (#14653) 2023-04-07 09:52:19 +08:00
fisker Cheung 3f1153ba27 Add parens to head of arrow function body instead of whole expression (#14599) 2023-03-29 09:13:46 +08:00
fisker aaffacce2c Merge remote-tracking branch 'remotes/upstream/main' into next
# Conflicts:
#	docs/browser.md
#	package.json
#	scripts/release/release.js
#	src/language-js/parse/postprocess/index.js
#	src/language-js/parse/postprocess/typescript.js
#	src/language-js/parse/typescript.js
#	src/language-js/print/type-parameters.js
#	tests/format/js/export-star/__snapshots__/jsfmt.spec.js.snap
#	tests/format/js/export-star/jsfmt.spec.js
#	tests/format/js/export/__snapshots__/jsfmt.spec.js.snap
#	tests/format/js/export/jsfmt.spec.js
#	tests/format/misc/typescript-only/__snapshots__/jsfmt.spec.js.snap
#	tests/format/typescript/decorators/jsfmt.spec.js
#	tests/format/typescript/export/jsfmt.spec.js
#	yarn.lock
2023-03-20 14:21:15 +08:00
fisker ddf3b43c33 Clean changelog 2023-03-20 14:09:05 +08:00
fisker Cheung 80419fa69e Remove unnecessary parentheses around class expression (#14409) 2023-03-09 15:22:27 +08:00
fisker Cheung 8036248b0a Move prettier-ignored node print into estree printer (#14406) 2023-03-06 15:40:18 +08:00
fisker Cheung 4a26d88f9a Merge branch 'main' into next
# Conflicts:
#	src/language-js/needs-parens.js
#	tests/config/format-test.js
2023-02-24 09:40:12 +08:00
fisker Cheung bc098779c4 Add missing parentheses for decorator (#14393) 2023-02-24 09:20:34 +08:00
fisker Cheung 24652d9186 Support babel v7.21 (#14391) 2023-02-24 08:59:53 +08:00
fisker CheungandGeorgii Dolzhykov add84358d8 Remove flow plugin from babel parser (#14314)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2023-02-10 17:27:17 +08:00
fisker Cheung cf409fe6a4 Clean changelog 2023-02-08 11:19:08 +08:00
fisker Cheung 9842b29ca3 Recognize @satisfies in Closure-style type casts (#14262) 2023-02-07 15:19:09 +08:00
Georgii Dolzhykov cfa5f27afe Avoid adding unnecessary indent to nested await (#14192) 2023-01-20 12:58:44 +02:00
fisker Cheung 0cd7e10447 Merge branch 'main' into next
# Conflicts:
#	docs/browser.md
#	src/language-js/print/literal.js
#	src/language-js/print/misc.js
#	src/language-js/printer-estree.js
#	tests/format/markdown/auto-link/jsfmt.spec.js
#	yarn.lock
2023-01-10 09:38:45 +08:00
Sosuke Suzuki a37ce0b8f6 Clean changelog_unreleased (#14144)
Clean changelog
2023-01-09 16:48:32 +09:00
fisker Cheung aaf919014f Fix comments after directive (#14081) 2023-01-07 16:43:44 +08:00
fisker Cheung acb7354f85 Merge branch 'main' into next
# Conflicts:
#	src/language-js/needs-parens.js
2023-01-04 16:02:27 +08:00
fisker Cheung f8e1ad806c Add parens to head of ExpressionStatement instead of whole statement (#14077) 2023-01-04 15:22:12 +08:00
fisker Cheung 468c514ba2 Fix inconsistent between array/tuple and object/record (#14065) 2023-01-04 15:07:07 +08:00
fisker Cheung f65768d00a Merge branch 'main' into next
# Conflicts:
#	package.json
#	scripts/release/yarn.lock
#	src/language-css/parser-postcss.js
#	src/language-css/printer-postcss.js
#	src/language-js/print/jsx.js
#	src/language-json/printer-estree-json.js
#	website/yarn.lock
#	yarn.lock
2023-01-04 14:25:53 +08:00
fisker Cheung e301b1f9ce Fix comments inside JSX attributes (#14082)
Fixes https://github.com/prettier/prettier/issues/11242
2022-12-30 10:36:58 +08:00
fisker Cheung 9afa8544eb Merge branch 'main' into next
# Conflicts:
#	src/language-js/needs-parens.js
2022-12-29 17:50:50 +08:00
fisker Cheung ef707da0a2 Fix formatting for auto-accessors with comments (#14038)
Fixes https://github.com/prettier/prettier/issues/14036
2022-12-29 17:17:54 +08:00