Commit Graph
492 Commits
Author SHA1 Message Date
fisker Cheung 6eda34db44 Test: Rename run_spec to runFormatTest (#15943) 2024-01-19 17:20:24 +08:00
fisker Cheung 10762eeaa0 Improve keyword detection in TSModuleDeclaration (#15925) 2024-01-16 10:28:40 +08:00
fisker Cheung 70c9c56c67 Improve babel parse error message (#15928) 2024-01-16 10:27:49 +08:00
renovate[bot]andfisker b4ed91bffb chore(deps): update typescript-eslint to v6.18.1 (#15881)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2024-01-15 14:42:44 +08:00
SUZUKI Sosuke cb8004f3f1 Fix formatting error on optional call expression and member chain (#15920) 2024-01-14 11:50:28 +09:00
Eelco Lempsink 0bfcb2d5a5 Fix css embed in JSX when using (only) a spread attribute (#15896) 2024-01-14 11:42:25 +09:00
SUZUKI Sosuke 7e862bbc41 Fix formatting error on member chain (#15915) 2024-01-13 04:12:55 +09:00
SUZUKI Sosuke 06c7e52da6 Avoid adding colon for track in 3rd expression of for blocks (#15887) 2024-01-08 15:20:06 +09:00
agajjarandfisker Cheung 5cae451c14 Improve GraphQL union types formatting (#15870)
* Fix:14234 added fix for formating graphql union type

* Fix:14234 clean up code and push the fix

* Fix:14234 added test cases

* Fix:14234 added changelog entry

* Fix:14234 cleanup changelog entry

* Fix:14234 cleanup changelog

* Update changelog_unreleased/graphql/15870.md

* Update changelog_unreleased/graphql/15870.md

---------

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-01-07 22:49:39 +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
fisker Cheung 84c169ecc2 Fix prettier-ignored angular control flow (#15827) 2024-01-02 13:48:34 +08:00
fisker Cheung 1dc924f2f2 Add jsonc parser (#15831) 2024-01-02 10:59:34 +08:00
Seiyaandfisker Cheung 82db5fcd0d Somewhat improve conditional type alias (#15811)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-12-28 23:46:34 +09: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
SUZUKI Sosukeandfisker 153ffd5104 Support formatting for Angular ICU expression (#15777)
Co-authored-by: fisker <lionkay@gmail.com>
2023-12-14 13:01:54 +09:00
Max Gurelaandfisker 2c689f3e30 fix(printer-glimmer): preserve path literal segments (#15605)
* fix(glimmer): preserve path literal segments

This change fixes scenarios where an input handlebars file containing literal segments would be
reformatted to unwrap the literal segments, causing syntax errors in the resulting output. An
example of this is below:

```
<!-- wrong: input.funky<api!response -->
{{input.[funky<api!response]}}
<!-- wrong: input.this one has spaces -->
{{input.[this one has spaces]}}
```

This also handles a scenario where the input contained deprecated '/' delimited paths, ensuring
that those paths are not wrapped with brackets. This exists to prevent breaking an existing test
`sub-expressions.hbs`. Handling it this way does lead to some minor ambiguity since glimmer does
not support these paths, but the ambiguity is probably better than breaking them entirely.

fixes #14207, preventing removal of brackets where necessary

---------

Co-authored-by: fisker <lionkay@gmail.com>
2023-12-13 16:18:24 +08:00
fisker Cheung ddf223a3ff Fix formatting of ternary (#15679) 2023-12-13 16:14:44 +08:00
fisker Cheung 8227c0a69e Fix formatting of prettier-ignored unclosed elements (#15748) 2023-12-13 16:13:26 +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
Mark Amery 1e30f66f39 Remove claim, untrue since over 5 years ago, that cursorOffset is incompatible with rangeStart/rangeEnd (#15750) 2023-12-08 16:35:02 +02: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 0ba2d693ba Fix unstable and ugly formatting for comments in destructuring patterns (#15708) 2023-11-24 00:56:14 +09:00
Arnaud 457e83a725 docs: update the JSON schema location to use https (#15674) 2023-11-18 15:51:29 +09:00
fisker Cheung ff57f5064d Fix @for angularControlFlowBlock (#15620) 2023-11-12 23:56:56 +08:00
fisker Cheung c433415d42 Fix formatting of "angularControlFlowBlock" in span (#15615) 2023-11-12 22:36:43 +08:00
0176a33db4 Support angular control flow (#15606)
Co-authored-by: dweizhe <d.weizhe@anyong.com.tw>
Co-authored-by: fisker <lionkay@gmail.com>
2023-11-12 20:01:30 +08:00
fisker Cheung 36d1b8b09d Fix babel error message (#15581) 2023-11-03 19:35:55 +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
Seiya c609058fd3 Support (type) satisfies never; (#15514) 2023-10-16 16:04:28 +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
SUZUKI Sosuke 14ddf452c4 Update @babel/parser to 7.23.0 (#15485) 2023-10-08 22:26:13 +08:00
Vivek Joshiandfisker Cheung d4d4b185e0 Fix: Encoding < and > in markdown urls (#15400)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-10-02 18:00:02 +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
SUZUKI Sosuke fa8cb85434 Support type arguments after typeof (#15466) 2023-09-28 12:57:38 +09: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
Tatsunori Uchino 0661f78a26 Don't split lines between Japanese kana & COMBINING KATAKANA-HIRAGANA (SEMI-)VOICED SOUND MARK (#15411)
* Don't split lines between Japanese kana & COMBINING KATAKANA-HIRAGANA (SEMI-)VOICED SOUND MARK

* Add changelog
2023-09-22 22:30:30 +09:00
Sam Zhou 6bff776efd Support type arguments on jsx opening elements for flow (#15429) 2023-09-20 00:35:18 +09:00
SUZUKI Sosuke 4169dbb871 Fix printing comment for the last operand of union types (#15409) 2023-09-16 21:52:02 +09:00
SUZUKI Sosuke c041f3fb4f Support embedded formatting in template literals annotated with as const (#15408) 2023-09-16 21:42:17 +09:00