Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typescript-estree): fix error handling on
ImportExpression
(#6587)
- Loading branch information
Showing
9 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...ages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/fixture.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,5 @@ | ||
import( | ||
"./source.json", | ||
{assert: {type: "json"}}, | ||
extraArgument | ||
); |
11 changes: 11 additions & 0 deletions
11
...ression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/1-TSESTree-Error.shot
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,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AST Fixtures expression ImportExpression _error_ extra-arguments TSESTree - Error 1`] = ` | ||
"TSError | ||
2 | \\"./source.json\\", | ||
3 | {assert: {type: \\"json\\"}}, | ||
> 4 | extraArgument | ||
| ^^^^^^^^^^^^^ Dynamic import requires exactly one or two arguments. | ||
5 | ); | ||
6 |" | ||
`; |
3 changes: 3 additions & 0 deletions
3
...expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AST Fixtures expression ImportExpression _error_ extra-arguments Babel - Error 1`] = `[SyntaxError: \`import()\` requires exactly one or two arguments. (1:0)]`; |
3 changes: 3 additions & 0 deletions
3
...ession/ImportExpression/fixtures/_error_/extra-arguments/snapshots/3-Alignment-Error.shot
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AST Fixtures expression ImportExpression _error_ extra-arguments Error Alignment 1`] = `"Both errored"`; |
1 change: 1 addition & 0 deletions
1
packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/fixture.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 @@ | ||
import(); |
8 changes: 8 additions & 0 deletions
8
...expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/1-TSESTree-Error.shot
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,8 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AST Fixtures expression ImportExpression _error_ no-arguments TSESTree - Error 1`] = ` | ||
"TSError | ||
> 1 | import(); | ||
| ^^^^^^^^ Dynamic import requires exactly one or two arguments. | ||
2 |" | ||
`; |
3 changes: 3 additions & 0 deletions
3
...rc/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AST Fixtures expression ImportExpression _error_ no-arguments Babel - Error 1`] = `[SyntaxError: \`import()\` requires exactly one or two arguments. (1:0)]`; |
3 changes: 3 additions & 0 deletions
3
...xpression/ImportExpression/fixtures/_error_/no-arguments/snapshots/3-Alignment-Error.shot
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AST Fixtures expression ImportExpression _error_ no-arguments Error Alignment 1`] = `"Both errored"`; |
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