From d4a8538f531533ddb0ee9be2d49edfda883ef532 Mon Sep 17 00:00:00 2001 From: fisker Date: Thu, 22 May 2025 04:03:35 +0800 Subject: [PATCH 1/2] test(ast-spec): snapshot codeframe of Babel parse error --- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../missing-body/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../_error_/enum/snapshots/2-Babel-Error.shot | 6 ++- .../namespace/snapshots/2-Babel-Error.shot | 6 ++- .../type-alias/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../assertion/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../async/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../decorator/snapshots/2-Babel-Error.shot | 6 ++- .../missing-body/snapshots/2-Babel-Error.shot | 6 ++- .../missing-id/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../import-kind/snapshots/2-Babel-Error.shot | 7 +++- .../missing-id/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../decorator/snapshots/2-Babel-Error.shot | 6 ++- .../missing-body/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../missing-id/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../missing-id/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../decorator/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../decorator/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../no-variables/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../no-arguments/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../call-expr/snapshots/2-Babel-Error.shot | 6 ++- .../literal/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../paren-expr/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../solo-const/snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 5 ++- .../decl-init/snapshots/2-Babel-Error.shot | 6 ++- .../decl-multi/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- packages/ast-spec/tests/fixtures.test.ts | 2 +- .../ast-spec/tests/util/serialize-error.ts | 42 ++++++++++++++++--- 234 files changed, 1421 insertions(+), 238 deletions(-) diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot index 0e64270303c2..ac409fa55ba0 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > export-missing-name > Babel - Error`] -SyntaxError: A class name is required. (1:13) +BabelError +> 1 | export class { } + | ^ A class name is required. (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot index 56fdd942ce87..c5774c25f7ed 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > implements-non-identifier > Babel - Error`] -SyntaxError: Unexpected token (1:21) +BabelError +> 1 | class Foo implements 'thing' {} + | ^ Unexpected token (1:21) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot index 2dec9742a619..cc16e7c77a49 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:9) +BabelError +> 1 | class Foo; + | ^ Unexpected token, expected "{" (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot index a61921db5773..e3f5ef8b8219 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-extends-type-param > Babel - Error`] -SyntaxError: Type argument list cannot be empty. (1:17) +BabelError +> 1 | class C extends D<> {} + | ^ Type argument list cannot be empty. (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot index 2c265df14f59..c2f76a98fb66 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:7) +BabelError +> 1 | class C<> {} + | ^ Type parameter list cannot be empty. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index dca1aa8e5e3c..c5b89c0e5107 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: A class name is required. (1:6) +BabelError +> 1 | class 'Foo' {} + | ^ A class name is required. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot index 2909d642ff49..2b75e5f4601f 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > non-identifier-type-param > Babel - Error`] -SyntaxError: Unexpected token (1:8) +BabelError +> 1 | class C<1> {} + | ^ Unexpected token (1:8) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot index 6efe9b3b7d81..3ec3216dc914 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportAllDeclaration > _error_ > missing-source > Babel - Error`] -SyntaxError: Unexpected token (1:13) +BabelError +> 1 | export * from; + | ^ Unexpected token (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot index f0134190e9c9..00afdab72fba 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportAllDeclaration > _error_ > non-string-source > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | export * from module; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot index 47bab5896cfe..491a0644ae9d 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > enum > Babel - Error`] -SyntaxError: Unexpected reserved word 'enum'. (1:15) +BabelError +> 1 | export default enum Foo {} + | ^ Unexpected reserved word 'enum'. (1:15) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot index 835d3e6b6496..c66fdce48dd5 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > namespace > Babel - Error`] -SyntaxError: Missing semicolon. (1:24) +BabelError +> 1 | export default namespace Foo {} + | ^ Missing semicolon. (1:24) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot index e9a8f373d0e6..ed1501e269f3 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > type-alias > Babel - Error`] -SyntaxError: Missing semicolon. (1:19) +BabelError +> 1 | export default type Foo = 1; + | ^ Missing semicolon. (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot index be123c950dde..3b031210e7bc 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > variable-declaration > Babel - Error`] -SyntaxError: Only expressions, functions or classes are allowed as the `default` export. (1:15) +BabelError +> 1 | export default const x = 1; + | ^ Only expressions, functions or classes are allowed as the `default` export. (1:15) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot index 30b0ef777673..c2035556e868 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > anonymous-class > Babel - Error`] -SyntaxError: A class name is required. (1:13) +BabelError +> 1 | export class {} + | ^ A class name is required. (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot index ff3be5f420c9..1a9032ea5498 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > anonymous-function-expression > Babel - Error`] -SyntaxError: Unexpected token (1:16) +BabelError +> 1 | export function () {} + | ^ Unexpected token (1:16) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot index f8f9efcc5de6..e475f632d493 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > arrow-function > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | export () => {}; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot index 89b0658efc67..75d9c00ff13a 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > assertion > Babel - Error`] -SyntaxError: A JSON module can only be imported with `default`. (1:9) +BabelError +> 1 | export { foo } from 'mod' assert { type: 'json' }; + | ^ A JSON module can only be imported with `default`. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot index d87d58c885c7..11121f10d40c 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-identifier-aliased-to-number-literal-with-source > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | export { a as 1 } from 'mod'; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot index 17bc155f8d2d..6d266bf43205 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-identifier-aliased-to-number-literal-without-source > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | export { a as 1 }; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot index c654860eb328..e749b5d25fe9 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-number-literal-with-source > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | export { 1 } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot index 27316defb9b0..e81fcdad7e08 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-number-literal-without-source > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | export { 1 }; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot index eb3e40a2aa15..f201320ca0db 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-aliased-to-identifier-without-source > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'a a' as b }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'a a' as 'b' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot index e91248efe601..8ab798e5cbab 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-aliased-to-number-literal-without-source > Babel - Error`] -SyntaxError: Unexpected token (1:18) +BabelError +> 1 | export { 'a a' as 1 }; + | ^ Unexpected token (1:18) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot index 4ca061f40171..c8830b8a6fd3 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-aliased-to-string-literal-without-source > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'a a' as 'b b' }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'a a' as 'b b' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot index 0a53b6d2d4df..6d73afe3c0f4 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-many-without-source > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'a a', 'b b' }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'a a' as 'a a' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot index b494c222dfda..648bcec8e693 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-without-source > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'a a' }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'a a' as 'a a' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot index 3859e1338fb1..7f9ff6798317 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > class-expression > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | export (class Foo {}); + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot index f25331d54178..38ab33ea3608 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > identifier-direct > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | export a; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot index 1fd7baadc861..3d38c4f9e70e 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > literal-direct > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | export 'a'; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot index 8a3517755f4f..ce11286822a7 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-id-and-not-exported > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | function () {} + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot index 559cc556fbd3..6e7c4870ff8b 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-type-param > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:12) +BabelError +> 1 | function foo<>() {} + | ^ Type parameter list cannot be empty. (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 907fe7ab23ae..b172c076d322 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | function 1() {} + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot index 270e3399f309..700ebba3a301 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > non-identifier-type-param > Babel - Error`] -SyntaxError: Unexpected token (1:13) +BabelError +> 1 | function foo<1>() {} + | ^ Unexpected token (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot index 7f8ffa9ce43d..0e3a25550420 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > default-and-named-and-namespace > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:16) +BabelError +> 1 | import a, * as b, { c } from 'mod'; + | ^ Unexpected token, expected "from" (1:16) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot index b2062a8fd6c9..43ab6d6cbb6e 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > default-number-literal > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | import 1 from 'mod'; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot index 6ef5744a9a28..6ac746b3158d 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > default-string-literal > Babel - Error`] -SyntaxError: Missing semicolon. (1:12) +BabelError +> 1 | import 'a a' from 'mod'; + | ^ Missing semicolon. (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot index acec1a57dfca..f0b67f5c7abb 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-and-namespace > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:12) +BabelError +> 1 | import { b }, * as a from 'a'; + | ^ Unexpected token, expected "from" (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot index aaff744edc32..28b4fb532bbe 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-identifier-aliased-to-number-literal > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | import { X as 1 } from 'mod'; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot index 14d274da0ea3..f13d1ad86b72 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-identifier-aliased-to-string-literal > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | import { X as 'a a' } from 'mod'; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot index 6e9cc05e0006..cbce80d6b85d 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal-aliased-to-identifier > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | import { 1 as X } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot index 1ce70d79982d..0dcbc46684f9 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal-aliased-to-number-literal > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | import { 1 as 1 } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot index 5d0ee5c06f74..0346b41d38d4 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal-aliased-to-string-literal > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | import { 1 as 'a a' } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot index 3ab2880006e0..b3307fa4f464 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | import { 1 } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot index ba56e25400c6..db49d74cedaa 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-string-literal-aliased-to-number-literal > Babel - Error`] -SyntaxError: Unexpected token (1:17) +BabelError +> 1 | import { "😭" as 1 } from 'mod'; + | ^ Unexpected token (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot index ef0d81834f4e..9294a60a3d0e 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-string-literal-aliased-to-string-literal > Babel - Error`] -SyntaxError: Unexpected token (1:17) +BabelError +> 1 | import { "😭" as 'a a' } from 'mod'; + | ^ Unexpected token (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot index 811ae5af3b35..d40da4301b86 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-string-literal > Babel - Error`] -SyntaxError: A string literal cannot be used as an imported binding. +BabelError +> 1 | import { "😭" } from 'mod'; + | ^ A string literal cannot be used as an imported binding. - Did you mean `import { "😭" as foo }`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot index 370a42b15d95..bfbfc646d0d0 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-and-default > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:13) +BabelError +> 1 | import * as b, a from 'mod'; + | ^ Unexpected token, expected "from" (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot index 2bfe0c35942c..c966103d9606 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-and-named > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:13) +BabelError +> 1 | import * as a, { b } from 'a'; + | ^ Unexpected token, expected "from" (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot index 7020792b5fc4..84285d1c9a9a 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-and-namespace > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:13) +BabelError +> 1 | import * as a, * as b from 'a'; + | ^ Unexpected token, expected "from" (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot index 4b27d2236cfa..444773331adc 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-non-identifier > Babel - Error`] -SyntaxError: Unexpected token (1:12) +BabelError +> 1 | import * as 1 from 'mod'; + | ^ Unexpected token (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot index b1be30149fd4..a4ab23c8f836 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > non-string-source > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | import * as x from module; + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot index b5d9b98f7eb0..ccb57192de34 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > async > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare async function foo(); + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot index e7d1600ede23..8bd1dcb842a0 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > declare-with-body > Babel - Error`] -SyntaxError: An implementation cannot be declared in ambient contexts. (1:0) +BabelError +> 1 | declare function foo(): void {}; + | ^ An implementation cannot be declared in ambient contexts. (1:0) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot index b0f108c8f608..0ba263f88f09 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-id-and-not-exported > Babel - Error`] -SyntaxError: Unexpected token (1:17) +BabelError +> 1 | declare function (); + | ^ Unexpected token (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot index f940ce76c084..541b20502249 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-type-param > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:20) +BabelError +> 1 | declare function foo<>(): void; + | ^ Type parameter list cannot be empty. (1:20) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 835c21eb16a8..4444ecfc395a 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Unexpected token (1:17) +BabelError +> 1 | declare function 1(); + | ^ Unexpected token (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot index 84802a911f35..d7a45581d36a 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > non-identifier-type-param > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | declare function f<1>(): void; + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot index 3b8661db0c38..5daf5307227b 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > decorator > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (1:6) +BabelError +> 1 | @decl enum Test {} + | ^ Leading decorators must be attached to a class declaration. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot index dd8d595e57ec..a82bf4ed854d 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > missing-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:8) +BabelError +> 1 | enum Foo; + | ^ Unexpected token, expected "{" (1:8) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot index 4418c7a1e888..359f07219f1e 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > missing-id > Babel - Error`] -SyntaxError: Unexpected token (1:5) +BabelError +> 1 | enum {} + | ^ Unexpected token (1:5) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 46552a854f62..cd61634a1671 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Unexpected token (1:5) +BabelError +> 1 | enum 1 {} + | ^ Unexpected token (1:5) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot index 617513c26619..44149a67c407 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > entity-name-invalid > Babel - Error`] -SyntaxError: Unexpected token (1:11) +BabelError +> 1 | import F = 1; + | ^ Unexpected token (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot index 8df50b7d4c15..bf2fbca1e9ff 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > external-module-ref-non-string-2 > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | import F = require(1 + 1); + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot index 9bf1d048bb0e..fa619f841cad 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > external-module-ref-non-string-3 > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | import F = require(`1`); + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot index d38a4d68b8cc..936a12f12e14 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > external-module-ref-non-string > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | import F = require(1); + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot index 9421f645d99f..2423a59ece17 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > import-kind > Babel - Error`] -SyntaxError: An import alias can not use 'import type'. (2:16) +BabelError + 1 | type T = 1; +> 2 | import type F = T; + | ^ An import alias can not use 'import type'. (2:16) + 3 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot index 4d8cd7ddc0cd..555339c64c79 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > missing-id > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | import = A.B; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot index 1b7acc81492b..dda3416a1214 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > missing-reference > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:8) +BabelError +> 1 | import F; + | ^ Unexpected token, expected "from" (1:8) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot index 9713e325ea24..d628e241dec7 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > decorator > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (1:6) +BabelError +> 1 | @decl interface Test {} + | ^ Leading decorators must be attached to a class declaration. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot index e53fa56c6786..eb2cf802539b 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:11) +BabelError +> 1 | interface F; + | ^ Unexpected token, expected "{" (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot index aebcf3e06ed4..d07294c49c41 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-extends > Babel - Error`] -SyntaxError: 'extends' list cannot be empty. (1:20) +BabelError +> 1 | interface F extends {} + | ^ 'extends' list cannot be empty. (1:20) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot index d6516a5c585d..311305cc57af 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-id > Babel - Error`] -SyntaxError: 'interface' declarations must be followed by an identifier. (1:10) +BabelError +> 1 | interface {} + | ^ 'interface' declarations must be followed by an identifier. (1:10) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot index 456d9b250c57..22e5cae199c7 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-type-param > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:11) +BabelError +> 1 | interface F<> {} + | ^ Type parameter list cannot be empty. (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot index b62fbf292fa0..65b6f8b67aed 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-extends > Babel - Error`] -SyntaxError: Unexpected token (1:20) +BabelError +> 1 | interface F extends 1 {} + | ^ Unexpected token (1:20) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 5daa78ba69de..c9df50bbff86 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: 'interface' declarations must be followed by an identifier. (1:10) +BabelError +> 1 | interface 1 {} + | ^ 'interface' declarations must be followed by an identifier. (1:10) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot index 03d74ec17daa..1c7e4398f35a 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-type-param > Babel - Error`] -SyntaxError: Unexpected token (1:12) +BabelError +> 1 | interface F<1> {} + | ^ Unexpected token (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot index 16fe0276b649..9a4e17520361 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > module-invalid-id > Babel - Error`] -SyntaxError: Missing semicolon. (1:6) +BabelError +> 1 | module 1 {} + | ^ Missing semicolon. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot index 9a5f13dad8e9..3c09b48c89e4 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > module-missing-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:8) +BabelError +> 1 | module F; + | ^ Unexpected token, expected "{" (1:8) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot index 38f3cc629b93..44e80efd9d15 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-declare-no-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:19) +BabelError +> 1 | declare namespace F; + | ^ Unexpected token, expected "{" (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot index 542fe6e7fcf6..77e6d42ec05f 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-id-literal > Babel - Error`] -SyntaxError: Missing semicolon. (1:9) +BabelError +> 1 | namespace 'a' {} + | ^ Missing semicolon. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot index 699035689429..f570ef75b13d 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-invalid-id > Babel - Error`] -SyntaxError: Missing semicolon. (1:9) +BabelError +> 1 | namespace 1 {} + | ^ Missing semicolon. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot index 516bca2e2d70..9eaea9131b54 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-no-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:11) +BabelError +> 1 | namespace F; + | ^ Unexpected token, expected "{" (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot index 95f461ed4516..af94e2dca261 100644 --- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSNamespaceExportDeclaration > _error_ > missing-id > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | export as namespace; + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index ce1d4566a724..2604d4552462 100644 --- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSNamespaceExportDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Unexpected token (1:20) +BabelError +> 1 | export as namespace 1; + | ^ Unexpected token (1:20) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot index 726aeb6d7ce3..bd3effe3de20 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > decorator > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (1:6) +BabelError +> 1 | @decl type Test = {}; + | ^ Leading decorators must be attached to a class declaration. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot index 1f660ee4bb9e..0aa1adadcafb 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > missing-type-parameter > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:6) +BabelError +> 1 | type T<> = 1; + | ^ Type parameter list cannot be empty. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 4cad91910783..fe78642818bf 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Missing semicolon. (1:4) +BabelError +> 1 | type 1 = 2; + | ^ Missing semicolon. (1:4) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot index f0022623ea80..bcf3c74735a2 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > non-identifier-type-parameter > Babel - Error`] -SyntaxError: Unexpected token (1:7) +BabelError +> 1 | type T<1> = 2; + | ^ Unexpected token (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot index 63d96fa8f413..c96b185741e0 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-destructure-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:13) +BabelError +> 1 | const { foo }; + | ^ Missing initializer in destructuring declaration. (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot index f19c9134851b..f6c5fb6e9694 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-destructure-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:18) +BabelError +> 1 | const { foo }: any; + | ^ Missing initializer in destructuring declaration. (1:18) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot index fbaf6994db12..0bdc8232084c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-definite-no-init > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:10) +BabelError +> 1 | const foo!; + | ^ Missing initializer in const declaration. (1:10) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot index d6d04284fdb0..3a6191ee1fd1 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-definite-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:15) +BabelError +> 1 | const foo!: any; + | ^ Missing initializer in const declaration. (1:15) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot index 4778736de1c9..b6caba1e3a80 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-no-init > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:9) +BabelError +> 1 | const foo; + | ^ Missing initializer in const declaration. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot index b114ab299fee..eb6f8b5c4c0c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:14) +BabelError +> 1 | const foo: any; + | ^ Missing initializer in const declaration. (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot index a4077cb77749..5adb20d1948b 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-const-destructure-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:29) +BabelError +> 1 | declare const { foo }: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:29) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot index 97938c07e956..714b75ab5786 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-const-id-definite-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:26) +BabelError +> 1 | declare const foo!: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:26) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot index 6527f12080d1..a8c480413692 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-const-id-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:25) +BabelError +> 1 | declare const foo: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:25) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot index c602f4cb545e..61ea7c4c9b4f 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-destructure-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:22) +BabelError +> 1 | declare let { foo } = 1; + | ^ Initializers are not allowed in ambient contexts. (1:22) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot index ea40786b38d6..db2c7091e208 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-destructure-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:27) +BabelError +> 1 | declare let { foo }: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:27) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot index 1a4d52e5efb7..7dcf5ae87a8e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-definite-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:19) +BabelError +> 1 | declare let foo! = 1; + | ^ Initializers are not allowed in ambient contexts. (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot index 2799404577f1..bb42e1891168 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-definite-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:24) +BabelError +> 1 | declare let foo!: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:24) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot index 9d1e1a93cb3c..79d191b1fea9 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:18) +BabelError +> 1 | declare let foo = 1; + | ^ Initializers are not allowed in ambient contexts. (1:18) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot index 7d3b4dbacd1d..89f962475274 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:23) +BabelError +> 1 | declare let foo: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:23) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot index 512c30b84f78..929b7944477c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using { foo } = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot index 7b5830248706..4997023f0aa4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using { foo }; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot index ef81adfc0b85..c2cecbb8104d 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-type-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using { foo }: any = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot index 2cf637689700..f80c5fc88016 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-type-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using { foo }: any; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot index c95370820204..506605699490 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo! = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot index 69bbfebd9e0d..6da6ff4f9888 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo!; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot index d109f14d40f9..d347213e6ad4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-type-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo!: any = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot index d41036eea117..3ece5982f90f 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-type-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo!: any; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot index 9ffd885b9fb3..c3883b0d2ef1 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot index 50648d64ba1d..62096b9772ac 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot index ccdb04651388..553ccd15573b 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-type-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo: any = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot index a605c534f9f6..11158f84f69e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-type-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo: any; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot index b81a030fdae0..6cf7effbdbfb 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-destructure-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:22) +BabelError +> 1 | declare var { foo } = 1; + | ^ Initializers are not allowed in ambient contexts. (1:22) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot index c716f5ee6e62..c5883210e4e9 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-destructure-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:27) +BabelError +> 1 | declare var { foo }: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:27) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot index 5599c8a79783..26b7602ac1d5 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-definite-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:19) +BabelError +> 1 | declare var foo! = 1; + | ^ Initializers are not allowed in ambient contexts. (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot index 4c73b29511d3..9b0332014fc4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-definite-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:24) +BabelError +> 1 | declare var foo!: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:24) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot index 7c80c93c3a1d..d23db1eb32cf 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:18) +BabelError +> 1 | declare var foo = 1; + | ^ Initializers are not allowed in ambient contexts. (1:18) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot index 0eece7d22e74..c50e75b93a0e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:23) +BabelError +> 1 | declare var foo: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:23) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot index ee1c40040dbb..70ea5eb9260e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > decorator > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (1:6) +BabelError +> 1 | @decl type Test = {}; + | ^ Leading decorators must be attached to a class declaration. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot index d3dbedec0c5e..1118f9cce9a0 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > let-destructure-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:11) +BabelError +> 1 | let { foo }; + | ^ Missing initializer in destructuring declaration. (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot index 90a0241d8eec..eac75eb96185 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > let-destructure-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:16) +BabelError +> 1 | let { foo }: any; + | ^ Missing initializer in destructuring declaration. (1:16) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot index 2f8edbf36213..6217ca96ac49 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > missing-id-with-value > Babel - Error`] -SyntaxError: Unexpected token (1:6) +BabelError +> 1 | const = 1; + | ^ Unexpected token (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot index 7be36c3bbd62..d58c5400eebf 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > no-variables > Babel - Error`] -SyntaxError: Unexpected token (1:5) +BabelError +> 1 | const; + | ^ Unexpected token (1:5) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot index 3c5579d38485..a557bde70a73 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-init > Babel - Error`] -SyntaxError: Using declaration cannot have destructuring patterns. (1:6) +BabelError +> 1 | using { foo } = 1; + | ^ Using declaration cannot have destructuring patterns. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot index 9c6a4fd029be..8f9f395f5be7 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-no-init > Babel - Error`] -SyntaxError: Using declaration cannot have destructuring patterns. (1:6) +BabelError +> 1 | using { foo }; + | ^ Using declaration cannot have destructuring patterns. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot index 11639dfd0961..4bfa641b372d 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-type-init > Babel - Error`] -SyntaxError: Using declaration cannot have destructuring patterns. (1:6) +BabelError +> 1 | using { foo }: any = 1; + | ^ Using declaration cannot have destructuring patterns. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot index 2843f96cd215..5172befcf8ec 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-type-no-init > Babel - Error`] -SyntaxError: Using declaration cannot have destructuring patterns. (1:6) +BabelError +> 1 | using { foo }: any; + | ^ Using declaration cannot have destructuring patterns. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot index 8d285d2c268d..65f7136c6dd4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-definite-no-init > Babel - Error`] -SyntaxError: Missing initializer in using declaration. (1:10) +BabelError +> 1 | using foo!; + | ^ Missing initializer in using declaration. (1:10) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot index e9809e204145..4abda6a53640 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-definite-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in using declaration. (1:15) +BabelError +> 1 | using foo!: any; + | ^ Missing initializer in using declaration. (1:15) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot index 25a73d34c442..491e41264099 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-no-init > Babel - Error`] -SyntaxError: Missing initializer in using declaration. (1:9) +BabelError +> 1 | using foo; + | ^ Missing initializer in using declaration. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot index 269b21209e25..07af234b3468 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in using declaration. (1:14) +BabelError +> 1 | using foo: any; + | ^ Missing initializer in using declaration. (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot index e8b80abcf677..00f7eed3ebd2 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > var-destructure-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:11) +BabelError +> 1 | var { foo }; + | ^ Missing initializer in destructuring declaration. (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot index 28b00d00ddee..9b74a4b499ec 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > var-destructure-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:16) +BabelError +> 1 | var { foo }: any; + | ^ Missing initializer in destructuring declaration. (1:16) + 2 | + diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot index af9f804ebc24..b099dd074fa8 100644 --- a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > AccessorProperty > _error_ > modifier-abstract-property-with-value > Babel - Error`] -SyntaxError: Property 'property' cannot have an initializer because it is marked abstract. (2:20) +BabelError + 1 | abstract class Foo { +> 2 | abstract property = 1; + | ^ Property 'property' cannot have an initializer because it is marked abstract. (2:20) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot index 9efd284b0d93..848b03e5c5b9 100644 --- a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > AccessorProperty > _error_ > modifier-override-with-no-extends > Babel - Error`] -SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. (2:2) +BabelError + 1 | class Foo { +> 2 | override accessor foo = 2; + | ^ This member cannot have an 'override' modifier because its containing class does not extend another class. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot index e191f9064a5c..6d6ec2a3e287 100644 --- a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > MethodDefinition > _error_ > duplicated-accessibility-modifiers > Babel - Error`] -SyntaxError: Accessibility modifier already seen. (2:9) +BabelError + 1 | class Foo { +> 2 | public public bar() {}; + | ^ Accessibility modifier already seen. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot index a29fa5ab09a0..05ef660a6ae1 100644 --- a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > MethodDefinition > _error_ > mixed-accessibility-modifiers > Babel - Error`] -SyntaxError: Accessibility modifier already seen. (2:9) +BabelError + 1 | class Foo { +> 2 | public protected bar() {}; + | ^ Accessibility modifier already seen. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot index 8493e50d46c6..7da522cb7532 100644 --- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > PropertyDefinition > _error_ > duplicated-accessibility-modifiers > Babel - Error`] -SyntaxError: Accessibility modifier already seen. (2:9) +BabelError + 1 | class Foo { +> 2 | public public bar; + | ^ Accessibility modifier already seen. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot index 2ad65ba9c9fd..3498ed99592a 100644 --- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > PropertyDefinition > _error_ > mixed-accessibility-modifiers > Babel - Error`] -SyntaxError: Accessibility modifier already seen. (2:9) +BabelError + 1 | class Foo { +> 2 | public protected bar; + | ^ Accessibility modifier already seen. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot index e172a1d225d5..0cf17825f8a7 100644 --- a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ImportExpression > _error_ > extra-arguments > Babel - Error`] -SyntaxError: `import()` requires exactly one or two arguments. (1:0) +BabelError +> 1 | import( + | ^ `import()` requires exactly one or two arguments. (1:0) + 2 | "./source.json", + 3 | {assert: {type: "json"}}, + 4 | extraArgument + diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot index 6fb52dd6f0b0..24bd7006421a 100644 --- a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ImportExpression > _error_ > no-arguments > Babel - Error`] -SyntaxError: `import()` requires exactly one or two arguments. (1:0) +BabelError +> 1 | import(); + | ^ `import()` requires exactly one or two arguments. (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot index 75be7695d3c1..f008887400ca 100644 --- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ObjectExpression > _error_ > missing-getter-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:11) +BabelError +> 1 | ({get foo();}) + | ^ Unexpected token, expected "{" (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot index 63c0979436ab..f88ac257cfaf 100644 --- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ObjectExpression > _error_ > missing-method-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:10) +BabelError +> 1 | ({method();}) + | ^ Unexpected token, expected "{" (1:10) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot index 2f6b7b23b6b4..1414079b7aed 100644 --- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ObjectExpression > _error_ > missing-setter-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:16) +BabelError +> 1 | ({set foo(value);}) + | ^ Unexpected token, expected "{" (1:16) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot index f254c274c881..11c9fa5deba0 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > call-expr > Babel - Error`] -SyntaxError: Invalid left-hand side in postfix operation. (1:0) +BabelError +> 1 | a()++; + | ^ Invalid left-hand side in postfix operation. (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot index 67b54975f662..c2766f769ac6 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > literal > Babel - Error`] -SyntaxError: Invalid left-hand side in postfix operation. (1:0) +BabelError +> 1 | 1++; + | ^ Invalid left-hand side in postfix operation. (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot index 91473dbcc636..7a3e4de5faf0 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > optional-chain > Babel - Error`] -SyntaxError: This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) +BabelError +> 1 | x?.y++; + | ^ This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot index 0ddfe456abaa..9dd7dbc9fb81 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > optional-chain2 > Babel - Error`] -SyntaxError: This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) +BabelError +> 1 | x?.y.z++; + | ^ This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot index 3c478bc81318..25bcdc744cb3 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > optional-chain3 > Babel - Error`] -SyntaxError: This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) +BabelError +> 1 | x?.y().z++; + | ^ This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot index 96d9daba8b0b..c99074e87e83 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > paren-expr > Babel - Error`] -SyntaxError: Invalid left-hand side in postfix operation. (1:1) +BabelError +> 1 | (a())++; + | ^ Invalid left-hand side in postfix operation. (1:1) + 2 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot index 802164c43fb8..c3064f2c191b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > abstract-class-with-abstract-static-constructor > Babel - Error`] -SyntaxError: 'static' modifier cannot be used with 'abstract' modifier. (4:11) +BabelError + 2 | + 3 | export abstract class AbstractSocket { +> 4 | abstract static constructor(); + | ^ 'static' modifier cannot be used with 'abstract' modifier. (4:11) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot index 0b00b4cdf6c5..aa73011ad650 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > abstract-class-with-override-property > Babel - Error`] -SyntaxError: Property 'foo' cannot have an initializer because it is marked abstract. (4:24) +BabelError + 2 | + 3 | abstract class SpecializedComponent extends SomeComponent { +> 4 | abstract override foo = 1; + | ^ Property 'foo' cannot have an initializer because it is marked abstract. (4:24) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot index 4bb592375d4a..1af0e07eb087 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > abstract-interface > Babel - Error`] -SyntaxError: 'abstract' modifier can only appear on a class, method, or property declaration. (3:7) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | export abstract interface I { + | ^ 'abstract' modifier can only appear on a class, method, or property declaration. (3:7) + 4 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot index 06bf7d76b398..c36fee2891bf 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > await-without-async-function > Babel - Error`] -SyntaxError: Unexpected reserved word 'await'. (4:14) +BabelError + 2 | + 3 | function foo() { +> 4 | const bar = await baz(); + | ^ Unexpected reserved word 'await'. (4:14) + 5 | return bar.qux; + 6 | } + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot index f33c24ea95a7..b4121cb4ae51 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-private-identifier-field-with-accessibility-error > Babel - Error`] -SyntaxError: Private elements cannot have an accessibility modifier ('private'). (4:2) +BabelError + 2 | + 3 | class Foo { +> 4 | private #priv1: string + | ^ Private elements cannot have an accessibility modifier ('private'). (4:2) + 5 | public #priv2: string + 6 | static #priv3: string + 7 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot index db76a5bf8aa9..69f1445d8735 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-constructor-and-type-parameters > Babel - Error`] -SyntaxError: Type parameters cannot appear on a constructor declaration. (4:13) +BabelError + 2 | + 3 | class C { +> 4 | constructor() { } + | ^ Type parameters cannot appear on a constructor declaration. (4:13) + 5 | + 6 | ['constructor']() { } + 7 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot index 4f49707b5721..448313d2ceb8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-export-parameter-properties > Babel - Error`] -SyntaxError: Unexpected keyword 'export'. (4:16) +BabelError + 2 | + 3 | class Foo { +> 4 | constructor(export a: string) { + | ^ Unexpected keyword 'export'. (4:16) + 5 | + 6 | } + 7 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot index f3b7c8370e86..6eecefc158d1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-implements-and-extends > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:57) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | class ClassWithParentAndInterface implements MyInterface extends MyOtherClass {} + | ^ Unexpected token, expected "," (3:57) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot index 93ba259b14c2..222ba46172fc 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-static-parameter-properties > Babel - Error`] -SyntaxError: Unexpected reserved word 'static'. (4:16) +BabelError + 2 | + 3 | class Foo { +> 4 | constructor(static a: string) { + | ^ Unexpected reserved word 'static'. (4:16) + 5 | + 6 | } + 7 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot index e27b8241af48..c2de560d7935 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-two-methods-computed-constructor > Babel - Error`] -SyntaxError: Type parameters cannot appear on a constructor declaration. (4:15) +BabelError + 2 | + 3 | class A { +> 4 | "constructor"(): number { + | ^ Type parameters cannot appear on a constructor declaration. (4:15) + 5 | } + 6 | + 7 | ["constructor"](): number { + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot index d36815d31301..8627909786fd 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > const-assertions > Babel - Error`] -SyntaxError: Identifier 'x' has already been declared. (13:4) +BabelError + 11 | + 12 | // Type '10' +> 13 | let x = 10; + | ^ Identifier 'x' has already been declared. (13:4) + 14 | + 15 | // Type 'readonly [10, 20]' + 16 | let y = [10, 20]; + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot index e3ebeee984c1..2810528b926b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > Babel - Error`] -SyntaxError: Unexpected token (4:4) +BabelError + 2 | + 3 | export enum Foo { +> 4 | [1], + | ^ Unexpected token (4:4) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot index 30b625fd5ba4..d296e5c547da 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > Babel - Error`] -SyntaxError: Unexpected token (4:4) +BabelError + 2 | + 3 | export enum Foo { +> 4 | ['baz'], + | ^ Unexpected token (4:4) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot index 2612787d1b85..f34477b53b70 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > Babel - Error`] -SyntaxError: Unexpected token (4:4) +BabelError + 2 | + 3 | export enum Foo { +> 4 | [x], + | ^ Unexpected token (4:4) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot index 580ccafe0581..55ec89897af8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-with-import-assertions > Babel - Error`] -SyntaxError: A JSON module can only be imported with `default`. (3:9) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | export { foo } from "mod" assert { type: "json" }; + | ^ A JSON module can only be imported with `default`. (3:9) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot index fbb578bcabad..3745c520879d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > import-type-error > Babel - Error`] -SyntaxError: A type-only import can specify a default import or named bindings, but not both. (3:0) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | import type foo, { bar } from 'bar'; + | ^ A type-only import can specify a default import or named bindings, but not both. (3:0) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot index 98c91ef49faf..227ecfb29f8c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > interface-with-construct-signature-with-parameter-accessibility > Babel - Error`] -SyntaxError: A parameter property is only allowed in a constructor implementation. (4:9) +BabelError + 2 | + 3 | interface Test { +> 4 | new (public x, private y); + | ^ A parameter property is only allowed in a constructor implementation. (4:9) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot index 35034cb9ecdf..fa95c78a4f0c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > new-target-in-arrow-function-body > Babel - Error`] -SyntaxError: `new.target` can only be used in functions or class properties. (3:16) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const b = () => new.target; + | ^ `new.target` can only be used in functions or class properties. (3:16) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot index 084bd81246e1..5b148e27fcc7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > var-with-definite-assignment > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (3:16) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const x!: string; + | ^ Missing initializer in const declaration. (3:16) + 4 | var y!: number; + 5 | let z!: object; + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot index a7759221c36d..c2a01fb21025 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-empty-extends-implements > Babel - Error`] -SyntaxError: Unexpected reserved word 'implements'. (3:18) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | class Foo extends implements Bar { + | ^ Unexpected reserved word 'implements'. (3:18) + 4 | + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot index 4ec40f4b3b0e..d66d7ee5ec1a 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-empty-extends > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (6:0) +BabelError + 4 | + 5 | } +> 6 | + | ^ Unexpected token, expected "{" (6:0) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot index 8e3eea6c1131..d9a512c232d2 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-extends-empty-implements > Babel - Error`] -SyntaxError: 'implements' list cannot be empty. (3:33) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | class Foo extends Bar implements { + | ^ 'implements' list cannot be empty. (3:33) + 4 | + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot index 9bc9aef71f23..b3835b41371c 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-multiple-implements > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:21) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | class a implements b implements c {} + | ^ Unexpected token, expected "," (3:21) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot index 78f8c4703d14..49920535e977 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-enum-declaration > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (3:5) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | @dec enum E {} + | ^ Leading decorators must be attached to a class declaration. (3:5) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot index 0e2ce63ec8c7..c21fbbfa8050 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-function > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (4:0) +BabelError + 2 | + 3 | @dec +> 4 | function b(){} + | ^ Leading decorators must be attached to a class declaration. (4:0) + 5 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot index 6c236792b4cf..cd433bb6eff6 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-interface-declaration > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (4:0) +BabelError + 2 | + 3 | @deco() +> 4 | interface M {} + | ^ Leading decorators must be attached to a class declaration. (4:0) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot index de18083b45ff..2de8a9c2e651 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-variable > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (4:0) +BabelError + 2 | + 3 | @deco() +> 4 | const a = 1 + | ^ Leading decorators must be attached to a class declaration. (4:0) + 5 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot index f59176307e6a..91534ecc195a 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression > Babel - Error`] -SyntaxError: Unexpected token (3:4) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | foo<>(); + | ^ Unexpected token (3:4) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot index 93efdda3f71f..14594e627a49 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-new-expression > Babel - Error`] -SyntaxError: Unexpected token (3:8) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | new Foo<>() + | ^ Unexpected token (3:8) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot index ada9518aae7f..50d06d9aa9bd 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments > Babel - Error`] -SyntaxError: Type argument list cannot be empty. (3:14) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const foo: Foo<> + | ^ Type argument list cannot be empty. (3:14) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot index bea6f602ef56..bc141a4b2018 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (3:11) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | function f1<>() {} + | ^ Type parameter list cannot be empty. (3:11) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot index 690ef1aa63bb..16a2f804505e 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-constructor > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (4:13) +BabelError + 2 | + 3 | class foo { +> 4 | constructor<>() {} + | ^ Type parameter list cannot be empty. (4:13) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot index 8865ff0be4c9..0338cc8a0dd9 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (3:20) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const foo = function<>() {} + | ^ Type parameter list cannot be empty. (3:20) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot index 78845bb622fc..e64d189f57d3 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method-signature > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (4:6) +BabelError + 2 | + 3 | interface foo { +> 4 | test<>(); + | ^ Type parameter list cannot be empty. (4:6) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot index 8edfff6a61ee..3094f70c4dea 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (4:6) +BabelError + 2 | + 3 | class foo { +> 4 | test<>() {} + | ^ Type parameter list cannot be empty. (4:6) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot index 18c13853083c..8a54317d1574 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (3:11) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | function f1<>() {} + | ^ Type parameter list cannot be empty. (3:11) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot index 4a5bede8b8ba..8fc83f6a5be4 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > enum-with-keywords > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (3:7) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | export private public protected static readonly abstract async enum X {} + | ^ Unexpected token, expected "{" (3:7) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot index 2cc0c09a7eaf..554c009cecd0 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > index-signature-parameters > Babel - Error`] -SyntaxError: Unexpected token, expected "]" (4:12) +BabelError + 2 | + 3 | type foo = { +> 4 | [a: string, b: string]: string; + | ^ Unexpected token, expected "]" (4:12) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot index c8fd8337e295..0c7e138c8054 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-empty-extends > Babel - Error`] -SyntaxError: 'extends' list cannot be empty. (3:22) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | interface Foo extends { + | ^ 'extends' list cannot be empty. (3:22) + 4 | + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot index 363365dcf16d..c422799a230e 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-implements > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (3:12) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | interface d implements e {} + | ^ Unexpected token, expected "{" (3:12) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot index 68489300cc2e..08b5aa8c4257 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-export > Babel - Error`] -SyntaxError: Unexpected token, expected ";" (4:9) +BabelError + 2 | + 3 | interface Foo { +> 4 | export [baz: string]: string; + | ^ Unexpected token, expected ";" (4:9) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot index 1647b535967c..86a7acc9b701 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-private > Babel - Error`] -SyntaxError: 'private' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | private [baz: string]: string; + | ^ 'private' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot index 2950f6174dcf..aa422f5e065f 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-protected > Babel - Error`] -SyntaxError: 'protected' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | protected [baz: string]: string; + | ^ 'protected' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot index 1d027ab3288d..7a6f073d84c1 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-public > Babel - Error`] -SyntaxError: 'public' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | public [baz: string]: string; + | ^ 'public' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot index d29363a7d59a..12fd7616e919 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-static > Babel - Error`] -SyntaxError: 'static' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | static [baz: string]: string; + | ^ 'static' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot index a0bf025bfd18..fa5282c6d766 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-export > Babel - Error`] -SyntaxError: Unexpected token, expected ";" (4:11) +BabelError + 2 | + 3 | interface Foo { +> 4 | export g(bar: string): void; + | ^ Unexpected token, expected ";" (4:11) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot index 4f4403185561..d5dbbcdfca6d 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-private > Babel - Error`] -SyntaxError: 'private' modifier cannot appear on a type member. (4:4) +BabelError + 2 | + 3 | interface Foo { +> 4 | private g(bar: string): void; + | ^ 'private' modifier cannot appear on a type member. (4:4) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot index 7c6aea8cbc42..567f70c03ab5 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-protected > Babel - Error`] -SyntaxError: 'protected' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | protected g(bar: string): void; + | ^ 'protected' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot index 67adc051ce12..9d0c9ab867f4 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-public > Babel - Error`] -SyntaxError: 'public' modifier cannot appear on a type member. (4:4) +BabelError + 2 | + 3 | interface Foo { +> 4 | public g(bar: string): void; + | ^ 'public' modifier cannot appear on a type member. (4:4) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot index e1d86c915bec..c6663365d284 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-readonly > Babel - Error`] -SyntaxError: 'readonly' modifier can only appear on a property declaration or index signature. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | readonly g(bar: string): void; + | ^ 'readonly' modifier can only appear on a property declaration or index signature. (4:2) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot index 9c86c96dcf2c..f3ef64ea4040 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-static > Babel - Error`] -SyntaxError: 'static' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | static g(bar: string): void; + | ^ 'static' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot index 5ce932646399..d2a84ab002b5 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-multiple-extends > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:26) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | interface foo extends bar extends baz {} + | ^ Unexpected token, expected "," (3:26) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot index 91b39c29c98a..6518ef2afcf9 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-export > Babel - Error`] -SyntaxError: Unexpected token, expected ";" (4:9) +BabelError + 2 | + 3 | interface Foo { +> 4 | export a: string; + | ^ Unexpected token, expected ";" (4:9) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot index 2f122b91e44a..504c0e300be5 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-private > Babel - Error`] -SyntaxError: 'private' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | private b: string; + | ^ 'private' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot index 3f79550c6121..09ee6837fbc8 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-protected > Babel - Error`] -SyntaxError: 'protected' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | protected a: string; + | ^ 'protected' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot index 57ead1416304..29882083cc96 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-public > Babel - Error`] -SyntaxError: 'public' modifier cannot appear on a type member. (4:4) +BabelError + 2 | + 3 | interface Foo { +> 4 | public a: string; + | ^ 'public' modifier cannot appear on a type member. (4:4) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot index b2a5dab697a4..cf0246ca09ed 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-static > Babel - Error`] -SyntaxError: 'static' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | static a: string; + | ^ 'static' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot index 5fa027e9cf4e..c05e5ad7cfa0 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-with-default-value > Babel - Error`] -SyntaxError: Unexpected token, expected ";" (4:14) +BabelError + 2 | + 3 | interface Foo { +> 4 | bar: string = 'a'; + | ^ Unexpected token, expected ";" (4:14) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot index ae893daf528c..ecc6c39a7e58 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-with-no-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (4:0) +BabelError + 2 | + 3 | interface Foo +> 4 | + | ^ Unexpected token, expected "{" (4:0) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot index 38311897df43..532294b0ddfa 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-with-optional-index-signature > Babel - Error`] -SyntaxError: Unexpected token (4:7) +BabelError + 2 | + 3 | interface Foo { +> 4 | [fff?: number]: string; + | ^ Unexpected token (4:7) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot index e15c3c0564bd..00507051d9c1 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > object-assertion-not-allowed > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:3) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | ({a!} = {}) + | ^ Unexpected token, expected "," (3:3) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot index 4008e062d595..e1f5b59abe76 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > object-optional-not-allowed > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:3) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | ({a?} = {}) + | ^ Unexpected token, expected "," (3:3) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot index 84f2232f20d1..f02a6ac4f0b2 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > solo-const > Babel - Error`] -SyntaxError: Unexpected token (3:5) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const + | ^ Unexpected token (3:5) + diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot index 77fa78f82897..a1b2396cef0c 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > expressions > _error_ > instantiation-expression > Babel - Error`] -SyntaxError: Unexpected token (5:7) +BabelError + 3 | a; + 4 | +> 5 | a; + | ^ Unexpected token (5:7) + 6 | a(); + 7 | a?.(); + 8 | a?.b(); + diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot index b4627fafc300..99340a2f665a 100644 --- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > parameter-decorators > _error_ > parameter-array-pattern-decorator > Babel - Error`] -SyntaxError: Unexpected token (4:28) +BabelError + 2 | + 3 | class Foo { +> 4 | bar(@special(true) [ bar ]: any) {} + | ^ Unexpected token (4:28) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot index 6d7c60703ac4..646af8ded572 100644 --- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > parameter-decorators > _error_ > parameter-rest-element-decorator > Babel - Error`] -SyntaxError: Unexpected token (4:21) +BabelError + 2 | + 3 | class Foo { +> 4 | bar(@special(true) ...foo: any) {} + | ^ Unexpected token (4:21) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot index 746f2d00e0bb..330f905389c4 100644 --- a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > parameter > TSParameterProperty > _error_ > override-function-parameter > Babel - Error`] -SyntaxError: A parameter property is only allowed in a constructor implementation. (1:13) +BabelError +> 1 | function foo(override parameter) {} + | ^ A parameter property is only allowed in a constructor implementation. (1:13) + 2 | + diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot index c01c6423d57f..56ac32bf65b0 100644 --- a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > parameter > TSParameterProperty > _error_ > override-method-parameter > Babel - Error`] -SyntaxError: A parameter property is only allowed in a constructor implementation. (2:9) +BabelError + 1 | class Foo { +> 2 | method(override parameter) {} + | ^ A parameter property is only allowed in a constructor implementation. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot index 45304cec97a8..49ba046f48b7 100644 --- a/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > special > CatchClause > _error_ > with-initializer > Babel - Error`] -SyntaxError: Unexpected token, expected ")" (3:9) +BabelError + 1 | try { + 2 | } +> 3 | catch (e = 1) { + | ^ Unexpected token, expected ")" (3:9) + 4 | } + 5 | + diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot index 14ba1326d51f..8066f19648c0 100644 --- a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > special > ExportSpecifier > _error_ > literal-specifier > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'A' as A }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'A' as 'A' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot index de1d87cc292d..155a5df05e1c 100644 --- a/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot @@ -1,4 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ForInStatement > _error_ > using-initializer > Babel - Error`] -SyntaxError: For-in loop may not start with 'using' declaration. (1:4) +BabelError +> 1 | for(using foo in {}); + | ^ For-in loop may not start with 'using' declaration. (1:4) + diff --git a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot index 7cee4dc26990..f9f88b371b57 100644 --- a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ForOfStatement > _error_ > decl-init > Babel - Error`] -SyntaxError: 'for-of' loop variable declaration may not have an initializer. (1:5) +BabelError +> 1 | for (const x = 1 of []) {} + | ^ 'for-of' loop variable declaration may not have an initializer. (1:5) + 2 | + diff --git a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot index 415f6f6fc038..fff804c7ba6b 100644 --- a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ForOfStatement > _error_ > decl-multi > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:12) +BabelError +> 1 | for (const x, y of []) {} + | ^ Missing initializer in const declaration. (1:12) + 2 | + diff --git a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot index fab92480a170..3cd37f4376f4 100644 --- a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ForOfStatement > _error_ > expr-not-assignment-target > Babel - Error`] -SyntaxError: Invalid left-hand side in for-of statement. (1:5) +BabelError +> 1 | for (1 of []) {} + | ^ Invalid left-hand side in for-of statement. (1:5) + 2 | + diff --git a/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot index 2c9a2de70deb..b96cae72438d 100644 --- a/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > SwitchStatement > _error_ > multiple-default-cases > Babel - Error`] -SyntaxError: Multiple default clauses. (2:10) +BabelError + 1 | switch (true) { +> 2 | default: default: + | ^ Multiple default clauses. (2:10) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot index 7ae654c72d7a..164119608484 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ThrowStatement > _error_ > missing-argument > Babel - Error`] -SyntaxError: Illegal newline after throw. (2:9) +BabelError + 1 | { +> 2 | throw + | ^ Illegal newline after throw. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot index ff33d238cf32..dd4ad391b99f 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > type > TSImportType > _error_ > type-import-type-with-import-attributes-assert > Babel - Error`] -SyntaxError: Unexpected token, expected "with" (1:23) +BabelError +> 1 | type A = import("A", { assert: { type: "json" } }); + | ^ Unexpected token, expected "with" (1:23) + 2 | + diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot index 9f5f417fcabd..0d9adec2645d 100644 --- a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > type > TSMappedType > _error_ > with-member-after > Babel - Error`] -SyntaxError: Unexpected token, expected "}" (3:2) +BabelError + 1 | type Mapped = { + 2 | [key in keyof O]: number; +> 3 | member: member; + | ^ Unexpected token, expected "}" (3:2) + 4 | }; + 5 | + diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot index c1f120be3d57..5b1a1229034e 100644 --- a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > type > TSMappedType > _error_ > with-member-before > Babel - Error`] -SyntaxError: Unexpected token, expected "]" (3:16) +BabelError + 1 | type Mapped = { + 2 | member: member; +> 3 | [key in keyof O]: number; + | ^ Unexpected token, expected "]" (3:16) + 4 | }; + 5 | + diff --git a/packages/ast-spec/tests/fixtures.test.ts b/packages/ast-spec/tests/fixtures.test.ts index 0660b3df3a7c..16534e6f0c1e 100644 --- a/packages/ast-spec/tests/fixtures.test.ts +++ b/packages/ast-spec/tests/fixtures.test.ts @@ -231,7 +231,7 @@ describe('AST Fixtures', async () => { await expect( [ `${vitestSnapshotHeader}\n\nexports[\`${expect.getState().currentTestName}\`]`, - babelParsed.error, + serializeError(babelParsed.error, contents), '', ].join('\n'), ).toMatchFileSnapshot(snapshotFiles.error.babel(2)); diff --git a/packages/ast-spec/tests/util/serialize-error.ts b/packages/ast-spec/tests/util/serialize-error.ts index 8a54fe232230..26f296a2b8c3 100644 --- a/packages/ast-spec/tests/util/serialize-error.ts +++ b/packages/ast-spec/tests/util/serialize-error.ts @@ -1,12 +1,9 @@ +import type { ParseError as BabelParseError } from '@babel/parser'; import { codeFrameColumns } from '@babel/code-frame'; import { TSError } from './parsers/typescript-estree-import'; -export function serializeError(error: unknown, contents: string): unknown { - if (!(error instanceof TSError)) { - return error; - } - +function serializeTSError(error: TSError, contents: string): string { const { location: { end, start }, message, @@ -23,3 +20,38 @@ ${codeFrameColumns( { highlightCode: false, message }, )}`; } + +type BabelError = SyntaxError & + BabelParseError & { loc: { column: number; line: number } }; + +const isBabelError = (error: unknown): error is BabelError => + error instanceof SyntaxError && + 'code' in error && + 'reasonCode' in error && + 'loc' in error; + +function serializeBabelError(error: BabelError, contents: string): string { + const { loc, message } = error; + + return `BabelError +${codeFrameColumns( + contents, + { + start: { column: loc.column + 1, line: loc.line }, + }, + { highlightCode: false, message }, +)} + `; +} + +export function serializeError(error: unknown, contents: string): unknown { + if (error instanceof TSError) { + return serializeTSError(error, contents); + } + + if (isBabelError(error)) { + return serializeBabelError(error, contents); + } + + return error; +} From 5482bccf140807c757c6675700802ec31d741d72 Mon Sep 17 00:00:00 2001 From: fisker Date: Thu, 22 May 2025 04:11:18 +0800 Subject: [PATCH 2/2] Add @babel/parser --- packages/ast-spec/package.json | 1 + yarn.lock | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index b88610c936ca..65d6e6947376 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -48,6 +48,7 @@ "@babel/code-frame": "^7.24.2", "@babel/core": "^7.24.4", "@babel/eslint-parser": "^7.24.1", + "@babel/parser": "^7.24.1", "@microsoft/api-extractor": "^7.47.11", "@types/babel__code-frame": "^7.0.6", "@types/babel__core": "^7.20.5", diff --git a/yarn.lock b/yarn.lock index 09f7355bb869..6dc3f936749d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -547,7 +547,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": version: 7.27.2 resolution: "@babel/parser@npm:7.27.2" dependencies: @@ -5392,6 +5392,7 @@ __metadata: "@babel/code-frame": ^7.24.2 "@babel/core": ^7.24.4 "@babel/eslint-parser": ^7.24.1 + "@babel/parser": ^7.24.1 "@microsoft/api-extractor": ^7.47.11 "@types/babel__code-frame": ^7.0.6 "@types/babel__core": ^7.20.5