This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rome_js_formatter): Inline object like pattern for formal paramet…
…er (#3802) Co-authored-by: Micha Reiser <[email protected]>
- Loading branch information
1 parent
3bcf54c
commit cb33205
Showing
7 changed files
with
119 additions
and
12 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
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
19 changes: 19 additions & 0 deletions
19
crates/rome_js_formatter/tests/specs/ts/function/function_parameters.ts
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,19 @@ | ||
export function formatNumber1( | ||
value: string, | ||
{ | ||
a, | ||
b, | ||
c, | ||
formatNumber, | ||
...props | ||
}: Omit<NumberFormatterProps, 'value' | 'defaultFractionDigits'> & { | ||
useGrouping?: boolean; | ||
} | ||
): string {} | ||
|
||
export function formatNumber2( | ||
value: string, | ||
{ a }: Omit<NumberFormatterProps, 'value' | 'defaultFractionDigits'> & { | ||
useGrouping?: boolean; | ||
} | ||
): string {} |
71 changes: 71 additions & 0 deletions
71
crates/rome_js_formatter/tests/specs/ts/function/function_parameters.ts.snap
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,71 @@ | ||
--- | ||
source: crates/rome_js_formatter/tests/spec_test.rs | ||
expression: function_parameters.ts | ||
--- | ||
|
||
# Input | ||
|
||
```js | ||
export function formatNumber1( | ||
value: string, | ||
{ | ||
a, | ||
b, | ||
c, | ||
formatNumber, | ||
...props | ||
}: Omit<NumberFormatterProps, 'value' | 'defaultFractionDigits'> & { | ||
useGrouping?: boolean; | ||
} | ||
): string {} | ||
|
||
export function formatNumber2( | ||
value: string, | ||
{ a }: Omit<NumberFormatterProps, 'value' | 'defaultFractionDigits'> & { | ||
useGrouping?: boolean; | ||
} | ||
): string {} | ||
|
||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Line width: 80 | ||
Quote style: Double Quotes | ||
Quote properties: As needed | ||
Trailing comma: All | ||
Semicolons: Always | ||
----- | ||
|
||
```js | ||
export function formatNumber1( | ||
value: string, | ||
{ | ||
a, | ||
b, | ||
c, | ||
formatNumber, | ||
...props | ||
}: Omit<NumberFormatterProps, "value" | "defaultFractionDigits"> & { | ||
useGrouping?: boolean; | ||
}, | ||
): string {} | ||
|
||
export function formatNumber2( | ||
value: string, | ||
{ | ||
a, | ||
}: Omit<NumberFormatterProps, "value" | "defaultFractionDigits"> & { | ||
useGrouping?: boolean; | ||
}, | ||
): string {} | ||
``` | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.