feat(prettier): print parameters in ArrowExpression (#1400)

This commit is contained in:
Dunqing 2023-11-18 13:37:55 +08:00 committed by GitHub
parent 7951849ec1
commit b251c10b09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -9,7 +9,10 @@ pub(super) fn print_arrow_function<'a>(
) -> Doc<'a> {
let mut parts = p.vec();
parts.push(ss!("() => "));
let parameters = expr.params.format(p);
parts.push(parameters);
parts.push(ss!(" => "));
if expr.expression {
let stmt = &expr.body.statements[0];
match stmt {

View file

@ -1,4 +1,4 @@
Compatibility: 90/881 (10.22%)
Compatibility: 92/881 (10.44%)
# Failed
@ -180,7 +180,6 @@ Compatibility: 90/881 (10.22%)
* break-calls/break.js
* break-calls/parent.js
* break-calls/react.js
* break-calls/reduce.js
### call/first-argument-expansion
* call/first-argument-expansion/expression-2nd-arg.js
@ -440,9 +439,6 @@ Compatibility: 90/881 (10.22%)
* do/call-arguments.js
* do/do.js
### dynamic-import
* dynamic-import/test.js
### empty-paren-comment
* empty-paren-comment/class-property.js
* empty-paren-comment/class.js