Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
disallowJSXAmbiguity
option to the TS syntax plugin
- Loading branch information
1 parent
6027225
commit 2e6cdfb
Showing
11 changed files
with
28 additions
and
3 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
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/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": [["syntax-typescript", { "disallowJSXAmbiguity": true }]] | ||
} |
1 change: 1 addition & 0 deletions
1
...bel-plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-assertion/input.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 @@ | ||
<T>x; |
3 changes: 3 additions & 0 deletions
3
...plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-assertion/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 @@ | ||
{ | ||
"throws": "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. (1:0)" | ||
} |
2 changes: 2 additions & 0 deletions
2
...yntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter-unambiguous/input.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,2 @@ | ||
<T,>() => 1; | ||
<T,>(x) => 1; |
3 changes: 3 additions & 0 deletions
3
...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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<T>() => 1; | ||
|
||
<T>(x) => 1; |
2 changes: 2 additions & 0 deletions
2
...bel-plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter/input.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,2 @@ | ||
<T>() => 1; | ||
<T>(x) => 1; |
3 changes: 3 additions & 0 deletions
3
...plugin-syntax-typescript/test/fixtures/disallow-jsx-ambiguity/type-parameter/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 @@ | ||
{ | ||
"throws": "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`. (1:0)" | ||
} |
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 @@ | ||
import runner from "@babel/helper-plugin-test-runner"; | ||
|
||
runner(import.meta.url); |
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