Brian Kim
38ae5d5210
Javascript: Use function literals in arguments to detect function composition ( #6033 )
2019-10-01 13:53:45 +03:00
Cyrille David
7cb0c23774
fix(handlebars): Use quotes from config in AttrNode ( #6377 )
2019-09-30 17:08:58 +03:00
Matthew Leffler
bb037eb218
TypeScript: Improve argument expansion with `as` type expressions ( #6471 )
2019-09-25 09:51:50 -03:00
Sosuke Suzuki
27e777e476
TypeScript: Keep type parameters inline for a variable declaration ( #6467 )
...
* Modify to keep inline type parameter with variable declaration
* Update CHENGELOG.unreleased.md
* Add tests
* Add tests
* Add pr number and link
2019-09-24 18:59:54 +03:00
Sosuke Suzuki
2e2368f5d7
JavaScript: Fix inconsistent indentation in switch statement ( #6514 )
...
* Add "SwitchStatement" to isInsideParenthesis
* Change tests
* Add tests
* Update CHANGELOG.unreleased.md
* Add pr number and link
2019-09-23 18:35:06 +02:00
Sosuke Suzuki
c5c8862333
JavaScript: Fix Bad format for multi-line optional chaining with comment ( #6506 )
2019-09-23 15:00:34 +03:00
Sosuke Suzuki
3f89bba231
JavaScript: Fix formatting on long named exports ( #6446 )
...
* Modify to put specific export inline
* Add tests
* Fix tests
* Modify to support default exports
* Update CHANGELOG.unreleased.md
* Modify to refactor
* Add pr link
* Modify to rename "content" -> "printed"
* Modify to define canBreak helpter
* Fix from linter
* Update CHANGELOG.unreleased.md
* Add tests
2019-09-11 12:10:34 +03:00
Sosuke Suzuki
8f0fdba4ba
JavaScript: Fix ugly formatting parens wrap binary expressions… ( #6441 )
...
* Modify to break specific call expression correctly
* Add tests
* Update CHANGELOG.unreleased.md
* Add tests
* Fix tests
* Add pr link
2019-09-07 14:46:00 +02:00
Kevin Gibbons
fd6ad2a623
handle empty object param patterns with type annotations ( #6438 )
...
* handle object patterns in function parameters with type annotations
* fix lint
* update changelog
2019-09-05 21:56:30 +02:00
Georgii Dolzhykov
ff9b2b6cb5
HTML: treat scripts as blocks (not inline) ( #6423 )
...
* HTML: treat scripts as blocks (not inline)
Fixes #6393
Signed-off-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
* update CHANGELOG.unreleased.md
2019-09-05 20:24:20 +02:00
Sosuke Suzuki
2523a017aa
JavaScript: object destructuring with parameter decorators ( #6411 )
2019-08-30 07:07:00 +02:00
Sosuke Suzuki
77e79bbfa5
TypeScript: Fixed to break line and add a semi in one execution on one line long mapped types ( #6420 )
2019-08-29 20:14:45 +02:00
Kevin Gibbons
01dc7aec65
fix: more readable parentheses for new-call ( #6412 )
2019-08-28 13:50:24 +03:00
Christopher Chedeau
43d03209d2
Update ?? precedence to match stage 3 proposal ( #6404 )
...
The spec was updated ( https://tc39.es/proposal-nullish-coalescing/ ) with the following two changes:
- ?? has lower precedence than ||. (previously equal)
- ?? cannot immediately contain, or be contained within, an && or || operation. (parens are now required)
The safe way to upgrade is to run prettier with just this change so that parenthesis are properly added. Then to upgrade the parser (only flow supports the new precendence in the next release, babel hasn't been updated yet) in prettier so that the new precedence is being used. Failure to do so will result in parse errors because of missing parenthesis so we will not have silent errors.
There was only 44 callsites mixing || and ?? in a confusing way in the Facebook codebase so it shouldn't be a huge deal in practice.
2019-08-20 14:26:21 -07:00
JounQin
68d3e74afe
fix(mdx): text with whitespace after JSX trim incorrectly ( #6340 )
2019-08-14 13:45:59 +03:00
Cyrille David
dd64842375
chore(Handlebars): Refactor test suite ( #6378 )
2019-08-12 10:35:13 -03:00
Sosuke Suzuki
9e5a5435a1
fix(TypeScript): specific union type breaks after opening parenthesis, but not before closing ( #6307 )
2019-08-08 16:48:37 +03:00
Sosuke Suzuki
ce366f0834
fix(JavaScript): bug when arrow fn as function parameter with newline ( #6301 )
2019-08-08 16:06:28 +03:00
Sosuke Suzuki
d66c5f82da
fix(HTML, Vue): don't break the template element included in a line shorter than print-width ( #6284 )
2019-08-08 15:18:37 +03:00
kamilic
7d0175ca90
feat: implement --vue-indent-script-and-style mentioned at pr-#… ( #6157 )
...
* feat: implement --vue-indent-script-and-style mentioned at pr-#6077
* docs: --vue-indent-script-and-style
* update new test case
* feat: playground for --vue-indent-script-and-style
* chores: Revert package.json version
* Remove noisy snapshots
2019-08-01 11:06:12 +02:00
JounQin
e5fbef238d
docs: fix possible typo AFAIK ( #6341 )
2019-07-30 11:48:14 +02:00
JounQin
998f98aade
fix: Adjacent JSX elements should be allowed in mdx ( #6332 )
...
* fix: adjacent JSX elements should be allowed in mdx
* chore: update CHANGELOG.unreleased.md for PR
* fix: adjacent JSX elements format issue of line
* fix: get html text from ast correctly
* fix: self closing issue
* fix: finally find out how to get original text from position
* chore: reset unnecessary changes
* fix: additional text after jsx should also be allowed
* fix: regression of empty text
* docs: add missing links
* fix linting...
2019-07-29 14:32:24 +03:00
Matt Kane
7286413ee5
Add JSON script types ( #6293 )
...
* Add JSON mimetypes
* Use endsWith
Co-Authored-By: Simon Lydell <simon.lydell@gmail.com>
2019-07-22 16:48:03 +03:00
Joffrey JAFFEUX
b557dc3603
[Glimmer/Handlebars] Forces multilines print when almost at max length ( #6249 )
2019-07-22 10:39:18 -03:00
Lucas Duailibe
91a7aa081e
Fix more bugs with double slash in TSX ( #6289 )
2019-07-11 11:27:53 -03:00
Sosuke Suzuki
033002cdc3
TypeScript, Flow: Fix breaking ordering comments in React.useEffect ( #6270 )
2019-07-10 11:34:23 -03:00
Sosuke Suzuki
74f4d2b3c0
JavaScript: Keep line breaks when tagged template literal has a single line comment. ( #6236 )
2019-07-10 10:56:53 -03:00
Sosuke Suzuki
cfba21f493
JavaScript: Keep unary expressions parentheses with comments ( #6217 )
2019-07-10 10:06:08 -03:00
Gavin Joyce
12b8176d5d
[Glimmer] preserve html entities ( #6234 )
2019-07-08 11:07:41 +02:00
Gavin Joyce
e8037ff250
[Glimmer] improve text/mustache formatting ( #6206 )
2019-06-19 09:53:27 -03:00
Gavin Joyce
ff7bc1c008
[Glimmer] improve text/mustache formatting ( #6186 )
2019-06-14 12:11:47 -03:00
Lucas Duailibe
4e8f911a29
Print comment following a JSX generic ( #6209 )
2019-06-10 09:30:54 -03:00
Lucas Duailibe
a90adf4753
Fix adding trailing comma in TS tuples ( #6199 )
2019-06-07 11:18:42 -03:00
Sosuke Suzuki
8812792e93
[TypeScript] Add trailing comma for only arrow functions in tsx. ( #6190 )
...
* Modify to add traling comma only for allow-function
* Add tests
* Update CHANGELOG.unreleased.md
* Add pr number and link
* Modify to improve RegExp to detect tsx file
2019-06-07 09:01:58 -03:00
Gavin Joyce
90308ebe76
fix: avoid unwanted whitespace in glimmer components ( #6178 )
2019-06-05 11:15:11 -03:00
Lucas Duailibe
2e6191fe77
Prevent adding quotes if there's a numeric literal as key ( #6138 )
2019-06-04 13:45:29 -03:00
Sosuke Suzuki
ed2055b81f
[TypeScript]Keep a trailing comma on tuple types ( #6172 )
2019-06-03 09:59:34 -03:00
Georgii Dolzhykov
e4f0df5bed
fix: nested embeds (JS in HTML in JS) ( #6038 )
2019-05-27 14:42:13 -03:00
Lucas Duailibe
f8875c1caa
Prevent parens around BindExpressions as properties of MemberExpressions ( #6159 )
2019-05-27 13:58:26 -03:00
Sosuke Suzuki
dcf4c21171
Keep necessary parentheses around the bind expression passed to "new" expression ( #6152 )
2019-05-27 09:21:34 -03:00
Sosuke Suzuki
3654108ebe
TypeScript: Keep line breaks within mapped types. ( #6146 )
2019-05-24 19:00:32 -03:00
Kevin Gibbons
c03fcfedb1
Address parentheses bugs for edge cases with call and new ( #6148 )
2019-05-24 11:09:17 -03:00
Georgii Dolzhykov
b3adb46ba9
Keep parens around non-null assertions for new-expressions only ( #6140 )
2019-05-22 19:01:47 -03:00
Lucas Duailibe
7e47b4ea26
Preserve parens around expressions in default export declaration that start with function or class ( #6133 )
2019-05-20 09:31:38 -03:00
Rich Hong
906d33749b
Add support for styled-jsx external styles ( #6089 )
2019-05-19 13:26:30 -03:00
Sosuke Suzuki
3b3c411642
TypeScript: Keep parentheses around a function called with non-null assertion. ( #6136 )
2019-05-19 13:15:02 -03:00
Sosuke Suzuki
4c64f13ef4
[TS] keep a pair of parentheses where there extra pairs. ( #6131 )
2019-05-17 18:13:40 -03:00
Lucas Duailibe
eca23e111f
Stop converting empty JSX elements to self-closing elements ( #6127 )
...
Co-Authored-By: Simon Lydell <simon.lydell@gmail.com>
2019-05-16 15:14:35 -03:00
Lucas Duailibe
df258d6d7e
Add parens in JSX spread element with expressions ( #6130 )
2019-05-16 15:06:41 -03:00
Evilebot Tnawi
7a76e5d08e
fix(javascript): correctly handle comments in empty arrow function expressions ( #6086 )
2019-05-15 12:46:12 -03:00