-
-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(js_formatter): keep parens around infer in unions/intersections (#…
- Loading branch information
Showing
6 changed files
with
88 additions
and
0 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
1 change: 1 addition & 0 deletions
1
crates/biome_js_formatter/tests/specs/ts/type/injfer_in_intersection.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 @@ | ||
type Type<T> = [T] extends [(infer S extends string) & {}] ? S : T; |
36 changes: 36 additions & 0 deletions
36
crates/biome_js_formatter/tests/specs/ts/type/injfer_in_intersection.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,36 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: ts/type/injfer_in_intersection.ts | ||
--- | ||
# Input | ||
|
||
```ts | ||
type Type<T> = [T] extends [(infer S extends string) & {}] ? S : T; | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# 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 commas: All | ||
Semicolons: Always | ||
Arrow parentheses: Always | ||
Bracket spacing: true | ||
Bracket same line: false | ||
Attribute Position: Auto | ||
----- | ||
|
||
```ts | ||
type Type<T> = [T] extends [(infer S extends string) & {}] ? S : T; | ||
``` |
1 change: 1 addition & 0 deletions
1
crates/biome_js_formatter/tests/specs/ts/type/injfer_in_union.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 @@ | ||
type Type<T> = [T] extends [(infer S extends string) | undefined] ? S : T; |
36 changes: 36 additions & 0 deletions
36
crates/biome_js_formatter/tests/specs/ts/type/injfer_in_union.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,36 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: ts/type/injfer_in_union.ts | ||
--- | ||
# Input | ||
|
||
```ts | ||
type Type<T> = [T] extends [(infer S extends string) | undefined] ? S : T; | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# 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 commas: All | ||
Semicolons: Always | ||
Arrow parentheses: Always | ||
Bracket spacing: true | ||
Bracket same line: false | ||
Attribute Position: Auto | ||
----- | ||
|
||
```ts | ||
type Type<T> = [T] extends [(infer S extends string) | undefined] ? S : T; | ||
``` |