Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
381277a
commit 718c6cb
Showing
56 changed files
with
619 additions
and
38 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
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-parser/test/fixtures/typescript/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": [["typescript", { "disallowAmbiguousJSXLike": true }]] | ||
} |
1 change: 1 addition & 0 deletions
1
...ages/babel-parser/test/fixtures/typescript/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; |
38 changes: 38 additions & 0 deletions
38
...s/babel-parser/test/fixtures/typescript/disallow-jsx-ambiguity/type-assertion/output.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,38 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, | ||
"errors": [ | ||
"SyntaxError: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. (1:0)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, | ||
"expression": { | ||
"type": "TSTypeAssertion", | ||
"start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, | ||
"typeAnnotation": { | ||
"type": "TSTypeReference", | ||
"start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, | ||
"typeName": { | ||
"type": "Identifier", | ||
"start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"T"}, | ||
"name": "T" | ||
} | ||
}, | ||
"expression": { | ||
"type": "Identifier", | ||
"start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, | ||
"name": "x" | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...el-parser/test/fixtures/typescript/disallow-jsx-ambiguity/type-parameter-babel-7/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
...arser/test/fixtures/typescript/disallow-jsx-ambiguity/type-parameter-babel-7/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 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
87 changes: 87 additions & 0 deletions
87
...parser/test/fixtures/typescript/disallow-jsx-ambiguity/type-parameter-babel-7/output.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,87 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, | ||
"errors": [ | ||
"SyntaxError: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`. (1:0)", | ||
"SyntaxError: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`. (2:0)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, | ||
"expression": { | ||
"type": "ArrowFunctionExpression", | ||
"start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [], | ||
"body": { | ||
"type": "NumericLiteral", | ||
"start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, | ||
"extra": { | ||
"rawValue": 1, | ||
"raw": "1" | ||
}, | ||
"value": 1 | ||
}, | ||
"typeParameters": { | ||
"type": "TSTypeParameterDeclaration", | ||
"start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, | ||
"params": [ | ||
{ | ||
"type": "TSTypeParameter", | ||
"start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, | ||
"name": "T" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":12,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, | ||
"expression": { | ||
"type": "ArrowFunctionExpression", | ||
"start":12,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "Identifier", | ||
"start":16,"end":17,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"x"}, | ||
"name": "x" | ||
} | ||
], | ||
"body": { | ||
"type": "NumericLiteral", | ||
"start":22,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, | ||
"extra": { | ||
"rawValue": 1, | ||
"raw": "1" | ||
}, | ||
"value": 1 | ||
}, | ||
"typeParameters": { | ||
"type": "TSTypeParameterDeclaration", | ||
"start":12,"end":15,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, | ||
"params": [ | ||
{ | ||
"type": "TSTypeParameter", | ||
"start":13,"end":14,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2}}, | ||
"name": "T" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...st/fixtures/typescript/disallow-jsx-ambiguity/type-parameter-unambiguous-babel-7/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
...ixtures/typescript/disallow-jsx-ambiguity/type-parameter-unambiguous-babel-7/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 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
Oops, something went wrong.