-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(format/js): fix arrow function type annotation inconsistency with…
… prettier (#2766)
- Loading branch information
Showing
3 changed files
with
135 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
crates/biome_js_formatter/tests/specs/tsx/arrow/issue-2736.tsx
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 @@ | ||
type MenuDividerProps = {}; | ||
type MedddddddddMenuDividerPropsMenuDividerPropsz = {}; | ||
type MedddddddddMenuDividerPropsMenuDividerPropszz = {}; | ||
type MedddddddddMenuDividerPropsMenuDividerPropszzz = {}; | ||
type ReactFFC<T> = {}; | ||
|
||
const ValueMenuDivider: React.FC<{ value: string } & Omit<MenuDividerProps, 'svalue'>> = ({ value }) => { | ||
return <OriginalMenuDivider />; | ||
}; | ||
|
||
const ValueMenuDivider2: React.FC<{ value: string } & Omit<MenuDividerProps, 'svalue', 'anothervalue'>> = ({ value }) => { | ||
return <OriginalMenuDivider />; | ||
}; | ||
|
||
const ValueMenuDivide: ReactFFC<MedddddddddMenuDividerPropsMenuDividerPropsz>=(x) => 5; | ||
|
||
const ValueMenuDividf: ReactFFC<MedddddddddMenuDividerPropsMenuDividerPropszz>=(x) => 5; | ||
|
||
const ValueMenuDividg: ReactFFC<MedddddddddMenuDividerPropsMenuDividerPropszzz>=(x) => 5; |
83 changes: 83 additions & 0 deletions
83
crates/biome_js_formatter/tests/specs/tsx/arrow/issue-2736.tsx.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,83 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: tsx/arrow/issue-2736.tsx | ||
--- | ||
# Input | ||
|
||
```tsx | ||
type MenuDividerProps = {}; | ||
type MedddddddddMenuDividerPropsMenuDividerPropsz = {}; | ||
type MedddddddddMenuDividerPropsMenuDividerPropszz = {}; | ||
type MedddddddddMenuDividerPropsMenuDividerPropszzz = {}; | ||
type ReactFFC<T> = {}; | ||
const ValueMenuDivider: React.FC<{ value: string } & Omit<MenuDividerProps, 'svalue'>> = ({ value }) => { | ||
return <OriginalMenuDivider />; | ||
}; | ||
const ValueMenuDivider2: React.FC<{ value: string } & Omit<MenuDividerProps, 'svalue', 'anothervalue'>> = ({ value }) => { | ||
return <OriginalMenuDivider />; | ||
}; | ||
const ValueMenuDivide: ReactFFC<MedddddddddMenuDividerPropsMenuDividerPropsz>=(x) => 5; | ||
const ValueMenuDividf: ReactFFC<MedddddddddMenuDividerPropsMenuDividerPropszz>=(x) => 5; | ||
const ValueMenuDividg: ReactFFC<MedddddddddMenuDividerPropsMenuDividerPropszzz>=(x) => 5; | ||
``` | ||
============================= | ||
# Outputs | ||
## Output 1 | ||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Quote style: Double Quotes | ||
JSX quote style: Double Quotes | ||
Quote properties: As needed | ||
Trailing comma: All | ||
Semicolons: Always | ||
Arrow parentheses: Always | ||
Bracket spacing: true | ||
Bracket same line: false | ||
Attribute Position: Auto | ||
----- | ||
```tsx | ||
type MenuDividerProps = {}; | ||
type MedddddddddMenuDividerPropsMenuDividerPropsz = {}; | ||
type MedddddddddMenuDividerPropsMenuDividerPropszz = {}; | ||
type MedddddddddMenuDividerPropsMenuDividerPropszzz = {}; | ||
type ReactFFC<T> = {}; | ||
const ValueMenuDivider: React.FC< | ||
{ value: string } & Omit<MenuDividerProps, "svalue"> | ||
> = ({ value }) => { | ||
return <OriginalMenuDivider />; | ||
}; | ||
const ValueMenuDivider2: React.FC< | ||
{ value: string } & Omit<MenuDividerProps, "svalue", "anothervalue"> | ||
> = ({ value }) => { | ||
return <OriginalMenuDivider />; | ||
}; | ||
const ValueMenuDivide: ReactFFC< | ||
MedddddddddMenuDividerPropsMenuDividerPropsz | ||
> = (x) => 5; | ||
const ValueMenuDividf: ReactFFC< | ||
MedddddddddMenuDividerPropsMenuDividerPropszz | ||
> = (x) => 5; | ||
const ValueMenuDividg: ReactFFC< | ||
MedddddddddMenuDividerPropsMenuDividerPropszzz | ||
> = (x) => 5; | ||
``` |