Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript-estree): throw errors for object methods without func…
…tion bodies (#6589)
- Loading branch information
Showing
15 changed files
with
79 additions
and
11 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
.../ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/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 @@ | ||
({get foo();}) |
8 changes: 8 additions & 0 deletions
8
...ion/ObjectExpression/fixtures/_error_/missing-getter-body/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 ObjectExpression _error_ missing-getter-body TSESTree - Error 1`] = ` | ||
"TSError | ||
> 1 | ({get foo();}) | ||
| ^ '{' expected. | ||
2 |" | ||
`; |
3 changes: 3 additions & 0 deletions
3
...ession/ObjectExpression/fixtures/_error_/missing-getter-body/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 ObjectExpression _error_ missing-getter-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:11)]`; |
3 changes: 3 additions & 0 deletions
3
...on/ObjectExpression/fixtures/_error_/missing-getter-body/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 ObjectExpression _error_ missing-getter-body Error Alignment 1`] = `"Both errored"`; |
1 change: 1 addition & 0 deletions
1
.../ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/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 @@ | ||
({method();}) |
8 changes: 8 additions & 0 deletions
8
...ion/ObjectExpression/fixtures/_error_/missing-method-body/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 ObjectExpression _error_ missing-method-body TSESTree - Error 1`] = ` | ||
"TSError | ||
> 1 | ({method();}) | ||
| ^ '{' expected. | ||
2 |" | ||
`; |
3 changes: 3 additions & 0 deletions
3
...ession/ObjectExpression/fixtures/_error_/missing-method-body/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 ObjectExpression _error_ missing-method-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:10)]`; |
3 changes: 3 additions & 0 deletions
3
...on/ObjectExpression/fixtures/_error_/missing-method-body/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 ObjectExpression _error_ missing-method-body Error Alignment 1`] = `"Both errored"`; |
1 change: 1 addition & 0 deletions
1
.../ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/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 @@ | ||
({set foo(value);}) |
8 changes: 8 additions & 0 deletions
8
...ion/ObjectExpression/fixtures/_error_/missing-setter-body/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 ObjectExpression _error_ missing-setter-body TSESTree - Error 1`] = ` | ||
"TSError | ||
> 1 | ({set foo(value);}) | ||
| ^ '{' expected. | ||
2 |" | ||
`; |
3 changes: 3 additions & 0 deletions
3
...ession/ObjectExpression/fixtures/_error_/missing-setter-body/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 ObjectExpression _error_ missing-setter-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:16)]`; |
3 changes: 3 additions & 0 deletions
3
...on/ObjectExpression/fixtures/_error_/missing-setter-body/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 ObjectExpression _error_ missing-setter-body 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
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