Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatibility between estree and TS plugin (#9700)
- Loading branch information
Showing
12 changed files
with
1,242 additions
and
20 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
4 changes: 4 additions & 0 deletions
4
packages/babel-parser/test/fixtures/estree/typescript/enum/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,4 @@ | ||
enum A { | ||
a, | ||
"r" | ||
} |
132 changes: 132 additions & 0 deletions
132
packages/babel-parser/test/fixtures/estree/typescript/enum/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,132 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 21, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 21, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "TSEnumDeclaration", | ||
"start": 0, | ||
"end": 21, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 5, | ||
"end": 6, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"identifierName": "A" | ||
}, | ||
"name": "A" | ||
}, | ||
"members": [ | ||
{ | ||
"type": "TSEnumMember", | ||
"start": 11, | ||
"end": 12, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 3 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 11, | ||
"end": 12, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 3 | ||
}, | ||
"identifierName": "a" | ||
}, | ||
"name": "a" | ||
} | ||
}, | ||
{ | ||
"type": "TSEnumMember", | ||
"start": 16, | ||
"end": 19, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 5 | ||
} | ||
}, | ||
"id": { | ||
"type": "Literal", | ||
"start": 16, | ||
"end": 19, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 5 | ||
} | ||
}, | ||
"value": "r", | ||
"raw": "\"r\"" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/estree/typescript/import-require/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 @@ | ||
import x = require ("asdfasdf"); |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/estree/typescript/import-require/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 @@ | ||
{ | ||
"sourceType": "module" | ||
} |
99 changes: 99 additions & 0 deletions
99
packages/babel-parser/test/fixtures/estree/typescript/import-require/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,99 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 32 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 32 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "TSImportEqualsDeclaration", | ||
"start": 0, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 32 | ||
} | ||
}, | ||
"isExport": false, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 7, | ||
"end": 8, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
}, | ||
"identifierName": "x" | ||
}, | ||
"name": "x" | ||
}, | ||
"moduleReference": { | ||
"type": "TSExternalModuleReference", | ||
"start": 11, | ||
"end": 31, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 11 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 31 | ||
} | ||
}, | ||
"expression": { | ||
"type": "Literal", | ||
"start": 20, | ||
"end": 30, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 20 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 30 | ||
} | ||
}, | ||
"value": "asdfasdf", | ||
"raw": "\"asdfasdf\"" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/estree/typescript/import/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,3 @@ | ||
let x: typeof import('./x'); | ||
let Y: import('./y').Y; | ||
let z: import("/z").foo.bar<string>; |
Oops, something went wrong.