Commit Graph
188 Commits
Author SHA1 Message Date
renovate[bot]andfisker be0f56c735 chore(deps): update babel (#16130)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2024-04-04 21:27:38 +08:00
Keith Layne f62bf4a191 Format embedded GQL in template literal statements (#16064)
Fixes #16007
2024-03-11 13:48:29 +09:00
Kevin Gibbons d50a4e4639 allow linebreaks in member expressions in template interpolations (#16116)
* allow linebreaks in member expressions in template interpolations

* lint

* add changelog
2024-03-10 12:43:37 +09:00
fisker Cheung 765fd0823e Exclude optional call from isTestCall (#16084)
Ignore optional call from `isTestCall`
2024-03-09 20:53:23 +09:00
fisker Cheung c4af355521 Fix isStringKeySafeToUnquote (#16058) 2024-02-18 17:59:06 +08:00
Jaswanth-Sriram-Veturiandfisker 2576e11863 Improve formatting of React useImperativeHandle hook (#16070)
Co-authored-by: fisker <lionkay@gmail.com>
2024-02-18 17:25:53 +08:00
SUZUKI Sosukeandfisker a642ecb373 Unquote keys in import attributes (#15888)
Co-authored-by: fisker <lionkay@gmail.com>
2024-02-07 14:54:39 +08:00
fisker Cheung d467987b4a Refactor ModuleExpression print (#16028) 2024-02-04 14:39:25 +08:00
fisker Cheung 6eda34db44 Test: Rename run_spec to runFormatTest (#15943) 2024-01-19 17:20:24 +08:00
SUZUKI Sosuke cb8004f3f1 Fix formatting error on optional call expression and member chain (#15920) 2024-01-14 11:50:28 +09:00
SUZUKI Sosuke 7e862bbc41 Fix formatting error on member chain (#15915) 2024-01-13 04:12:55 +09:00
fisker Cheung 5b215c3d26 Fix comment print in if (#15826) 2024-01-03 11:20:17 +08:00
fisker Cheung ff9c0839ac Fix inconsistencies for ChainElements (#15806) 2024-01-03 11:11:32 +08:00
Alexander Kachkaev 1ea2fd059a Add eslint-plugin-simple-import-sort (#15817) 2023-12-18 03:34:12 +08:00
Kevin Gibbons cb6fea81fb Avoid introducing linebreaks in template interpolations (#15209) 2023-12-17 18:10:20 +08:00
fisker Cheung ddf223a3ff Fix formatting of ternary (#15679) 2023-12-13 16:14:44 +08:00
Seiyaandfisker Cheung 224f70fb09 Stabilize member chain with empty line (#15522)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-12-13 16:12:03 +08:00
Mark Amery be2fe89b43 Add a bunch more cursor position test cases (#15787) 2023-12-13 13:18:20 +08:00
0d1ffb3a91 Consistently use tabs in ternaries when useTabs is true (#15662)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: SUZUKI Sosuke <aosukeke@gmail.com>
2023-12-10 17:10:57 +09:00
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
fisker Cheung 4c3cfa7a81 Support TypeScript 5.3 (#15718) 2023-12-05 15:39:24 +08:00
fisker Cheung b15d287f81 Update Jest to v30 (#15580) 2023-11-27 23:25:58 +08: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 4b432496df Support deferred import evaluation and source phase import syntax (#15487) 2023-10-09 08:52:48 +09:00
SUZUKI Sosuke edfe46051f Support optional chaining assignment (#15488) 2023-10-09 08:36:11 +09: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
SUZUKI Sosukeandfisker Cheung 1ce97d13a3 Support TypeScript 5.2 using / await using declaration (#15321)
* Update `@typescript-eslint` packages

* Install `typescript`

* Tweaks snapshot tests

* Tweaks error files

* Add tests for `using` with types

* Add changelog

* Update misc tests

* Update snapshots

* Revert misc tests and remove `typescript`

* Update changelog_unreleased/typescript/15321.md

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

* Fix file name typo

* Keep valid file

* Update tests

* Update changelog_unreleased/typescript/15321.md

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

* Remove non-existing filenames.

---------

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-08-29 15:51:50 +09:00
fisker Cheung f75f717c4e Allow break require() argument (#15256) 2023-08-23 15:58:06 +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
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 fa48415617 Bump Prettier dependency to 3.0.0 2023-07-05 21:50:05 +09:00
renovate[bot]andfisker 25fa483e35 chore(deps): update dependency typescript to v5.1.5 (#14896)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2023-07-04 11:26:24 +08:00
renovate[bot]andfisker 61804e2516 chore(deps): update dependency espree to v9.6.0 (#15000)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2023-07-03 10:26:24 +08: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
renovate[bot] bf581d35cf chore(deps): update dependency acorn to v8.9.0 (#14951)
Signed-off-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-18 10:43:10 +08: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 4965a790cb Forbid decorators on object property (#14661) 2023-04-04 09:07:15 +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 1c80e0104f Fix tests 2023-03-21 16:33:16 +08:00