Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print trailing comma after a single TS generic in arrow fns (#14113)
- Loading branch information
1 parent
a6d77d0
commit 1c32b67
Showing
9 changed files
with
17 additions
and
6 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
2 changes: 1 addition & 1 deletion
2
packages/babel-generator/test/fixtures/typescript/arrow-function-async-generic/output.js
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 |
---|---|---|
@@ -1 +1 @@ | ||
async <T>(a: T): T => a; | ||
async <T,>(a: T): T => a; |
2 changes: 2 additions & 0 deletions
2
...bel-generator/test/fixtures/typescript/arrow-function-generic-tsx-trailing-comma/input.js
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,2 @@ | ||
// Verify typescript doesn't change anything inside type parameter declaration | ||
const foo = <T,>(a: T): T => a; |
3 changes: 3 additions & 0 deletions
3
...generator/test/fixtures/typescript/arrow-function-generic-tsx-trailing-comma/options.json
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,3 @@ | ||
{ | ||
"plugins": ["jsx", "typescript"] | ||
} |
2 changes: 2 additions & 0 deletions
2
...el-generator/test/fixtures/typescript/arrow-function-generic-tsx-trailing-comma/output.js
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,2 @@ | ||
// Verify typescript doesn't change anything inside type parameter declaration | ||
const foo = <T,>(a: T): T => a; |
2 changes: 1 addition & 1 deletion
2
packages/babel-generator/test/fixtures/typescript/arrow-function-generic-tsx/output.js
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// Same as `generic`. Verify that JSX doesn't change things. | ||
<T>(a: T): T => a; | ||
<T,>(a: T): T => a; |
2 changes: 1 addition & 1 deletion
2
packages/babel-generator/test/fixtures/typescript/arrow-function-generic/output.js
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 |
---|---|---|
@@ -1 +1 @@ | ||
<T>(a: T): T => a; | ||
<T,>(a: T): T => a; |
4 changes: 2 additions & 2 deletions
4
...ntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter-unambiguous/output.js
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<T>() => 1; | ||
<T,>() => 1; | ||
|
||
<T>(x) => 1; | ||
<T,>(x) => 1; |
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