forked from prettier/prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor, optimize and fix call args expansion (prettier#13341)
- Loading branch information
Showing
15 changed files
with
616 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#### Fix edge cases of the first call argument expansion (#13341 by @thorn0) | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
export default whatever(function (a: { | ||
aaaaaaaaa: string; | ||
bbbbbbbbb: string; | ||
ccccccccc: string; | ||
}) { | ||
return null; | ||
}, "xyz"); | ||
|
||
call( | ||
function() { | ||
return 1; | ||
}, | ||
$var ?? $var ?? $var ?? $var ?? $var ?? $var ?? $var ?? $var ?? $var ?? 'test' | ||
); | ||
|
||
// Prettier stable | ||
export default whatever(function (a: { | ||
aaaaaaaaa: string; | ||
bbbbbbbbb: string; | ||
ccccccccc: string; | ||
}) { | ||
return null; | ||
}, | ||
"xyz"); | ||
|
||
call(function () { | ||
return 1; | ||
}, $var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
"test"); | ||
|
||
// Prettier main | ||
export default whatever(function (a: { | ||
aaaaaaaaa: string, | ||
bbbbbbbbb: string, | ||
ccccccccc: string, | ||
}) { | ||
return null; | ||
}, "xyz"); | ||
|
||
call( | ||
function () { | ||
return 1; | ||
}, | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
$var ?? | ||
"test", | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.