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
Alex Rattray and Alex 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
Alex Rattray
e02f16415b
Improve changelog generation DX for contributors ( #15412 )
...
* Make docs on generating changelog actually work
* Make a yarn gen:changelog command and reformat CONTRIBUTING docs
2023-09-18 14:37:05 +09:00
Alex Rattray
77310c49ea
Refactor simple member expressions etc ( #15423 )
2023-09-17 23:30:18 +09:00
Alex Rattray
28d097bbf5
Add test cases for questioning ternaries ( #13952 )
...
## Description
Extracts test cases that I added for https://github.com/prettier/prettier/pull/13183 to make it easier to visualize the changes that PR makes, as @vjeux [requested](https://github.com/prettier/prettier/pull/13183#discussion_r990820889 ).
## Checklist
<!-- Please ensure you’ve done all of these things (if applicable). -->
<!-- You can replace the `[ ]` with `[x]` to mark each task as done. -->
- [x] I’ve added tests to confirm my change works.
- [x] I’ve read the [contributing guidelines](https://github.com/prettier/prettier/blob/main/CONTRIBUTING.md ).
<!-- Please DO NOT remove the playground link -->
**✨ [Try the playground for this PR](https://prettier.io/playground-redirect )✨ **
2022-12-07 15:46:40 -05:00
Alex Rattray
850493e424
Add doc build ( #6009 )
2019-03-25 09:44:22 -07:00
Alex Rattray
606c5abbfc
Merge pull request #3324 from suchipi/arrow_parens
...
Simple arrow function parens option
2017-11-28 10:23:56 -05:00
Alex Rattray
a7223d8262
Merge pull request #2973 from karl/jsx-collapse-multiple-jsx-whitespaces
...
Collapse multiple JSX whitespaces
2017-10-03 23:31:16 -07:00
Alex Rattray
f0e207280a
Merge pull request #2398 from suchipi/improve_jsx_formatting
...
Improve JSX Formatting
2017-07-13 23:46:06 -07:00
Alex Rattray
ef91e28434
Merge pull request #2442 from karl/jsx-inline-single-expression
...
Allow single expressions in JSX to be inline
2017-07-12 21:32:48 -07:00
Alex Rattray
5fa8df331e
Add cli option for --no-semi ( #1223 )
2017-04-12 18:51:08 -07:00
Alex Rattray
36bec87d17
Enable no-semi mode and protect against ASI failures ( #1129 )
2017-04-11 13:50:47 -07:00
Alex Rattray
d0666c3da4
Fix leading comment inside returned SequenceExpression ( #1133 )
2017-04-05 13:41:35 -07:00
Alex Rattray
24c314da01
Recursively find leading comments inside ReturnStatements ( #955 )
2017-03-08 17:06:18 -08:00
Alex Rattray
50602aecbb
[JSX] Break if opening element breaks ( #942 )
2017-03-07 17:19:05 -08:00
Alex Rattray
475208d22a
[JSX] Don't wrap JSX Elements in parentheses if they are inside JSX Expression Containers ( #845 )
2017-03-01 12:05:57 -08:00
Alex Rattray
aef1ac61c9
[JSX] Break before and after jsx whitespace ( #836 )
2017-02-28 13:30:54 -08:00
Alex Rattray
f73ae2978e
[JSX] Don't add newline following newline ( #690 )
2017-02-14 13:41:51 -08:00
Alex Rattray
91d4f400a4
[JSX] jsx-whitespace breaks with parent ( fixes #622 ) ( #626 )
2017-02-07 13:47:34 -05:00
Alex Rattray
ee593bb645
[JSX] Fix spurious newline ( fixes #614 ) ( #628 )
2017-02-07 09:58:25 -05:00
Alex Rattray
86d1264097
Fix ternary indent bug ( #577 )
...
* Add test.js files back to source control
* Fix ternary indent bug (#564 )
2017-02-02 10:37:59 -08:00
Alex Rattray
be8f13dd24
[JSX] Handle non-breaking space ( #557 )
2017-02-01 15:29:42 -08:00
Alex Rattray
a9b7016c71
[JSX] Handle each line of text separately, allow up to one extra newline ( #455 )
...
* [JSX] Treat each line of text in a paragraph as its own group
* [JSX] Allow one extra newline
2017-01-27 14:20:01 -05:00
Alex Rattray
60fa5dae29
Don't break up JSXOpeningElement if it only has a single text attribute ( #488 )
2017-01-26 17:22:56 -05:00
Alex Rattray
72c9424c53
Indent ternaries ( #484 )
2017-01-26 11:58:40 -08:00
Alex Rattray
52a44610be
[JSX] Split elements on newlines and preserve whitespace (w/@yamafaktory) ( #234 )
2017-01-18 16:25:20 -05:00
Alex Rattray
47102bc3ef
Add regression tests for long JSX Expression contents
2017-01-13 14:22:49 -05:00
Alex Rattray
4fe16bda4d
Multiline JSX opening tag breaks children out too (for #73 )
2017-01-13 14:22:49 -05:00
Alex Rattray
2e1e6eece2
JSX maintains spaces that matter ( fixes #30 and thus part of #73 )
2017-01-13 14:22:49 -05:00
Alex Rattray
b09a02084f
Break JSXOpeningElement between attributes ( fixes #15 )
2017-01-13 14:22:49 -05:00
Alex Rattray
d91a28ef81
Wrap Stateless JSX Arrow Functions and Assignment in Parens (fixes part of #73 )
2017-01-13 14:22:49 -05:00