Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update missed
hasPlugin
checks, and add estree tests
- Loading branch information
1 parent
13b7f56
commit 01bdaa6
Showing
15 changed files
with
176 additions
and
13 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
packages/babel-parser/test/fixtures/estree/dynamic-import/import-attributes-null/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("module"); |
3 changes: 3 additions & 0 deletions
3
...ages/babel-parser/test/fixtures/estree/dynamic-import/import-attributes-null/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": ["estree", "importAttributes"] | ||
} |
27 changes: 27 additions & 0 deletions
27
packages/babel-parser/test/fixtures/estree/dynamic-import/import-attributes-null/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,27 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, | ||
"expression": { | ||
"type": "ImportExpression", | ||
"start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, | ||
"source": { | ||
"type": "Literal", | ||
"start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, | ||
"value": "module", | ||
"raw": "\"module\"" | ||
}, | ||
"attributes": null | ||
} | ||
} | ||
] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/estree/dynamic-import/import-attributes/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("module", { with: { type: "json" } }); |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/estree/dynamic-import/import-attributes/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": ["estree", "importAttributes"] | ||
} |
70 changes: 70 additions & 0 deletions
70
packages/babel-parser/test/fixtures/estree/dynamic-import/import-attributes/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,70 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, | ||
"expression": { | ||
"type": "ImportExpression", | ||
"start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, | ||
"source": { | ||
"type": "Literal", | ||
"start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, | ||
"value": "module", | ||
"raw": "\"module\"" | ||
}, | ||
"attributes": { | ||
"type": "ObjectExpression", | ||
"start":17,"end":43,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":43}}, | ||
"properties": [ | ||
{ | ||
"type": "Property", | ||
"start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23},"identifierName":"with"}, | ||
"name": "with" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "ObjectExpression", | ||
"start":25,"end":41,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":41}}, | ||
"properties": [ | ||
{ | ||
"type": "Property", | ||
"start":27,"end":39,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31},"identifierName":"type"}, | ||
"name": "type" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "Literal", | ||
"start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}}, | ||
"value": "json", | ||
"raw": "\"json\"" | ||
}, | ||
"kind": "init" | ||
} | ||
] | ||
}, | ||
"kind": "init" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...babel-parser/test/fixtures/estree/import-attributes/valid-syntax-with-attributes/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 foo from "foo.json" with { type: "json" }; |
9 changes: 9 additions & 0 deletions
9
...l-parser/test/fixtures/estree/import-attributes/valid-syntax-with-attributes/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,9 @@ | ||
{ | ||
"plugins": [ | ||
"flow", | ||
"jsx", | ||
"estree", | ||
"importAttributes" | ||
], | ||
"sourceType": "module" | ||
} |
51 changes: 51 additions & 0 deletions
51
...el-parser/test/fixtures/estree/import-attributes/valid-syntax-with-attributes/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,51 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ImportDeclaration", | ||
"start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, | ||
"specifiers": [ | ||
{ | ||
"type": "ImportDefaultSpecifier", | ||
"start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, | ||
"local": { | ||
"type": "Identifier", | ||
"start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, | ||
"name": "foo" | ||
} | ||
} | ||
], | ||
"importKind": "value", | ||
"source": { | ||
"type": "Literal", | ||
"start":16,"end":26,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":26}}, | ||
"value": "foo.json", | ||
"raw": "\"foo.json\"" | ||
}, | ||
"attributes": [ | ||
{ | ||
"type": "ImportAttribute", | ||
"start":34,"end":46,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":46}}, | ||
"key": { | ||
"type": "Identifier", | ||
"start":34,"end":38,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":38},"identifierName":"type"}, | ||
"name": "type" | ||
}, | ||
"value": { | ||
"type": "Literal", | ||
"start":40,"end":46,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":46}}, | ||
"value": "json", | ||
"raw": "\"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
4 changes: 0 additions & 4 deletions
4
...experimental/import-attributes-deprecatedAssertKeyword/trailing-comma-dynamic/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
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: 0 additions & 4 deletions
4
...el-parser/test/fixtures/experimental/import-attributes/trailing-comma-dynamic/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