Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@babel/eslint-parser: fix ImportExpression node to match ESTree spec (#…
…10828) * @babel/eslint-parser: fix ImportExpression node to match ESTree spec * Update caller name for @babel/core.parseSync * Move logic into estree plugin * Add estree plugin tests * Fix Flow error * Fix flow * Remove extra properties on ImportExpression node * Incorporate review feedback
- Loading branch information
1 parent
5156d3e
commit 7b54a94
Showing
15 changed files
with
174 additions
and
30 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
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
6 changes: 2 additions & 4 deletions
6
...ges/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{ | ||
"plugins": [ | ||
"estree" | ||
] | ||
} | ||
"plugins": ["estree"] | ||
} |
6 changes: 2 additions & 4 deletions
6
...ges/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{ | ||
"plugins": [ | ||
"estree" | ||
] | ||
} | ||
"plugins": ["estree"] | ||
} |
6 changes: 2 additions & 4 deletions
6
...ges/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{ | ||
"plugins": [ | ||
"estree" | ||
] | ||
} | ||
"plugins": ["estree"] | ||
} |
6 changes: 2 additions & 4 deletions
6
...ges/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{ | ||
"plugins": [ | ||
"estree" | ||
] | ||
} | ||
"plugins": ["estree"] | ||
} |
6 changes: 2 additions & 4 deletions
6
...ges/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{ | ||
"plugins": [ | ||
"estree" | ||
] | ||
} | ||
"plugins": ["estree"] | ||
} |
5 changes: 1 addition & 4 deletions
5
packages/babel-parser/test/fixtures/estree/bigInt/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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
{ | ||
"plugins": [ | ||
"estree", | ||
"bigInt" | ||
] | ||
"plugins": ["estree", "bigInt"] | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/estree/dynamic-import/basic/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 @@ | ||
const a = import("a"); |
116 changes: 116 additions & 0 deletions
116
packages/babel-parser/test/fixtures/estree/dynamic-import/basic/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,116 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "VariableDeclaration", | ||
"start": 0, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
}, | ||
"declarations": [ | ||
{ | ||
"type": "VariableDeclarator", | ||
"start": 6, | ||
"end": 21, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 21 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 6, | ||
"end": 7, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"identifierName": "a" | ||
}, | ||
"name": "a" | ||
}, | ||
"init": { | ||
"type": "ImportExpression", | ||
"start": 10, | ||
"end": 21, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 10 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 21 | ||
} | ||
}, | ||
"source": { | ||
"type": "Literal", | ||
"start": 17, | ||
"end": 20, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 17 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"value": "a", | ||
"raw": "\"a\"" | ||
} | ||
} | ||
} | ||
], | ||
"kind": "const" | ||
} | ||
] | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/estree/dynamic-import/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", "dynamicImport"] | ||
} |